Skip to content

Commit

Permalink
Merge branch 'production'
Browse files Browse the repository at this point in the history
  • Loading branch information
joshk committed Aug 7, 2011
2 parents 5df6f5e + a990b6f commit ce148d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/build/notifications.rb
Expand Up @@ -41,7 +41,7 @@ def emails_disabled?
end

def notifications
config ? config['notifications'] : {}
config.try(:fetch, 'notifications', {}) || {}
end
end
end
6 changes: 6 additions & 0 deletions test/unit/build/notifications_test.rb
Expand Up @@ -67,6 +67,12 @@ def setup
assert_contains_recipients(build.unique_recipients, recipients)
end

test "given the builds configuration exists but has no email details, unique_recipients contains the owner details" do
build = Factory(:build, :repository => repository, :config => {})
build.repository.stubs(:owner_email).returns('owner-1@email.com,owner-2@email.com')
assert_contains_recipients(build.unique_recipients, build.repository.owner_email)
end

protected

def assert_contains_recipients(actual, expected)
Expand Down

0 comments on commit ce148d1

Please sign in to comment.