summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-07-13 12:39:42 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-08-03 13:17:10 +0200
commit3239ee672e7d499a91cf01389daad3cc00a80ffc (patch)
tree84ba076cfdd1828aa5eed872b3c0786deb8170be /spec
parent2d83084807592176d04d84010943a385d75d1d7d (diff)
downloadgitlab-ci-3239ee672e7d499a91cf01389daad3cc00a80ffc.tar.gz
Fix service testing
Diffstat (limited to 'spec')
-rw-r--r--spec/models/mail_service_spec.rb26
1 files changed, 2 insertions, 24 deletions
diff --git a/spec/models/mail_service_spec.rb b/spec/models/mail_service_spec.rb
index 97f29f0..d66a659 100644
--- a/spec/models/mail_service_spec.rb
+++ b/spec/models/mail_service_spec.rb
@@ -121,7 +121,7 @@ describe MailService do
it do
should_email(commit.git_author_email)
should_email("jeroen@example.com")
- mail.execute(build)
+ mail.execute(build) if mail.can_execute?(build)
end
def should_email(email)
@@ -152,28 +152,6 @@ describe MailService do
end
end
- describe 'successful build and cannot test service' do
- let(:project) {
- FactoryGirl.create(:project,
- email_add_pusher: true,
- email_only_broken_builds: true,
- email_recipients: "jeroen@example.com")
- }
- let(:commit) { FactoryGirl.create(:commit, project: project) }
- let(:build) { FactoryGirl.create(:build, status: :success, commit: commit) }
-
- before do
- mail.stub(
- project: project
- )
- build
- end
-
- it do
- mail.can_test?.should == false
- end
- end
-
describe 'retried build should not receive email' do
let(:project) {
FactoryGirl.create(:project,
@@ -194,7 +172,7 @@ describe MailService do
Build.retry(build)
should_email(commit.git_author_email)
should_email("jeroen@example.com")
- mail.execute(build)
+ mail.execute(build) if mail.can_execute?(build)
end
def should_email(email)