From 7fab337b7d63a43e4ece39b1878e2441b2956858 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 18 Sep 2012 13:29:10 +0400 Subject: [PATCH] #575: added new spec, updated comments --- spec/models/build_list_observer_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/models/build_list_observer_spec.rb b/spec/models/build_list_observer_spec.rb index 56d152325..b8933dbc8 100644 --- a/spec/models/build_list_observer_spec.rb +++ b/spec/models/build_list_observer_spec.rb @@ -20,16 +20,21 @@ describe BuildListObserver do should have(1).item end - it "gets notification by email when mass build and status - Build published" do + it "gets notification by email when auto_publish and status - Build published" do build_list.update_attributes(:auto_publish => true, :status => BuildList::BUILD_PUBLISHED) should have(1).item end - it "doesn't get notification by email when mass build and status - Build complete" do + it "doesn't get notification by email when auto_publish and status - Build complete" do build_list.update_attributes(:auto_publish => true, :status => BuildServer::SUCCESS) should have(:no).items end + it "doesn't get notification by email when mass build" do + build_list.update_attributes(:mass_build_id => 1, :status => BuildList::BUILD_PUBLISHED) + should have(:no).item + end + it "doesn't get notification by email when notification by email has been disabled" do notifier.update_attribute(:can_notify, false) build_list.update_attribute(:status, BuildServer::SUCCESS) @@ -38,6 +43,7 @@ describe BuildListObserver do end subject { ActionMailer::Base.deliveries } + context "user created build task" do let!(:notifier) { user.notifier } before do