From bedf9f92d8151765f24653bb9e1ed5b8769a77c1 Mon Sep 17 00:00:00 2001 From: cake Date: Tue, 30 Nov 2010 23:22:42 +0900 Subject: [PATCH] =?utf8?q?basic=E8=AA=8D=E8=A8=BC=E3=82=92production?= =?utf8?q?=E3=81=AE=E3=81=BF=E3=81=AB=E9=99=90=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 1 + config/config.yml | 5 +++++ spec/controllers/songs_controller_spec.rb | 11 +++++++++++ spec/support/blueprints.rb | 6 ------ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8b8ec10..ded529e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,6 +8,7 @@ class ApplicationController < ActionController::Base 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 diff --git a/config/config.yml b/config/config.yml index 60ff807..1ede9df 100644 --- a/config/config.yml +++ b/config/config.yml @@ -5,3 +5,8 @@ development: <<: *common user_name: 'user' password: 'pass' + +test: + <<: *common + user_name: 'test_user' + password: 'test_pass' diff --git a/spec/controllers/songs_controller_spec.rb b/spec/controllers/songs_controller_spec.rb index c7be5f0..b3f24ea 100644 --- a/spec/controllers/songs_controller_spec.rb +++ b/spec/controllers/songs_controller_spec.rb @@ -7,4 +7,15 @@ describe SongsController do 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 diff --git a/spec/support/blueprints.rb b/spec/support/blueprints.rb index 8278b82..0bf614a 100644 --- a/spec/support/blueprints.rb +++ b/spec/support/blueprints.rb @@ -1,11 +1,5 @@ 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" } -- 2.11.0