diff --git a/spec/controllers/deploys_controller_spec.rb b/spec/controllers/deploys_controller_spec.rb index 0d3477d..63daacb 100644 --- a/spec/controllers/deploys_controller_spec.rb +++ b/spec/controllers/deploys_controller_spec.rb @@ -12,7 +12,7 @@ describe DeploysController do 'scm_revision' => '19d77837eef37902cf5df7e4445c85f392a8d0d5', 'message' => 'johns first deploy' } - @app = Factory(:app_with_watcher, :api_key => 'APIKEY') + @app = Factory(:app_with_watcher, :notify_on_deploys => true, :api_key => 'APIKEY') end it 'finds the app via the api key' do @@ -34,7 +34,7 @@ describe DeploysController do post :create, :deploy => @params, :api_key => 'APIKEY' end - it 'sends an email notification' do + it 'sends an email notification when configured to do so' do post :create, :deploy => @params, :api_key => 'APIKEY' email = ActionMailer::Base.deliveries.last email.to.should include(@app.watchers.first.email) @@ -61,3 +61,4 @@ describe DeploysController do end end + diff --git a/spec/models/deploy_spec.rb b/spec/models/deploy_spec.rb index 1908bfb..762e3b8 100644 --- a/spec/models/deploy_spec.rb +++ b/spec/models/deploy_spec.rb @@ -20,7 +20,7 @@ describe Deploy do it 'should send an email notification' do Mailer.should_receive(:deploy_notification). and_return(mock('email', :deliver => true)) - Factory(:deploy, :app => Factory(:app_with_watcher)) + Factory(:deploy, :app => Factory(:app_with_watcher, :notify_on_deploys => true)) end context 'when the app has resolve_errs_on_deploy set to false' do -- libgit2 0.21.2