forked from zendesk/samson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more test cases for thorough testing
- Loading branch information
1 parent
13c5d65
commit 029139c
Showing
2 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,13 @@ def stub_add_changeset | |
commit1.stubs("author_email").returns("[email protected]") | ||
commit2 = stub("commit2") | ||
commit2.stubs("author_email").returns("[email protected]") | ||
changeset.stubs(:commits).returns([commit1, commit2]) | ||
commit3 = stub("commit3") | ||
commit3.stubs("author_email").returns("[email protected]") | ||
commit4 = stub("commit4") | ||
commit4.stubs("author_email").returns("[email protected]") | ||
commit5 = stub("commit5") | ||
commit5.stubs("author_email").returns("[email protected]") | ||
changeset.stubs(:commits).returns([commit1, commit2, commit3, commit4, commit5]) | ||
deploy.stubs(:changeset).returns(changeset) | ||
end | ||
|
||
|
@@ -114,15 +120,23 @@ def stub_add_changeset | |
|
||
it "includes committer emails when JENKINS_NOTIFY_COMMITTERS is set" do | ||
with_env 'JENKINS_NOTIFY_COMMITTERS': "1" do | ||
stub_build_with_parameters("emails": '[email protected],[email protected],[email protected]') | ||
stub_build_with_parameters("emails": '[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]') | ||
stub_get_build_id_from_queue(1) | ||
jenkins.build.must_equal 1 | ||
end | ||
end | ||
|
||
it "filters emails by GOOGLE_DOMAIN" do | ||
with_env 'GOOGLE_DOMAIN': 'example1.com' do | ||
stub_build_with_parameters("emails": "") | ||
with_env 'GOOGLE_DOMAIN': '@example.com' do | ||
stub_build_with_parameters({}) | ||
stub_get_build_id_from_queue(1) | ||
jenkins.build.must_equal 1 | ||
end | ||
end | ||
|
||
it "filters emails by GOOGLE_DOMAIN when JENKINS_NOTIFY_COMMITTERS is set" do | ||
with_env 'GOOGLE_DOMAIN': '@example.com', 'JENKINS_NOTIFY_COMMITTERS': '1' do | ||
stub_build_with_parameters("emails": '[email protected],[email protected],[email protected]') | ||
stub_get_build_id_from_queue(1) | ||
jenkins.build.must_equal 1 | ||
end | ||
|