filter_parameter_logging :password
def authenticate
+ return true if RAILS_ENV.downcase != "production"
authenticate_or_request_with_http_basic do |user_name, password|
user_name == AppConfig.user_name && password == AppConfig.password
end
<<: *common
user_name: 'user'
password: 'pass'
+
+test:
+ <<: *common
+ user_name: 'test_user'
+ password: 'test_pass'
controller.should be_an_instance_of(SongsController)
end
+ it "トップページにアクセスできる" do
+ get :index
+ response.should be_success
+ end
+
+ it "新しい曲のフォーム" do
+ get :new
+ assigns[:song].should be_instance_of Song
+ end
+
+
end
require 'machinist/active_record'
-Program.blueprint do
- name { "a program" }
- note { "a note about this program..." }
- play_on { Date.today }
-end
-
Song.blueprint do
code { "C" }
title { "a title of song" }