Avoid relying on the order in which emails are sent
This commit is contained in:
parent
21d60e359a
commit
77e8a16a15
3 changed files with 13 additions and 12 deletions
|
@ -28,7 +28,7 @@ Lint/ParenthesesAsGroupedExpression:
|
||||||
|
|
||||||
# Offense count: 542
|
# Offense count: 542
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Max: 270
|
Max: 280
|
||||||
|
|
||||||
# Offense count: 12
|
# Offense count: 12
|
||||||
Metrics/BlockNesting:
|
Metrics/BlockNesting:
|
||||||
|
|
|
@ -1914,15 +1914,15 @@ EOF
|
||||||
end
|
end
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
||||||
email = ActionMailer::Base.deliveries.first
|
email = ActionMailer::Base.deliveries.find { |e| e.to.first == "test@openstreetmap.org" }
|
||||||
|
assert_not_nil email
|
||||||
assert_equal 1, email.to.length
|
assert_equal 1, email.to.length
|
||||||
assert_equal "[OpenStreetMap] pulibc_test2 has commented on one of your changesets", email.subject
|
assert_equal "[OpenStreetMap] pulibc_test2 has commented on one of your changesets", email.subject
|
||||||
assert_equal "test@openstreetmap.org", email.to.first
|
|
||||||
|
|
||||||
email = ActionMailer::Base.deliveries.second
|
email = ActionMailer::Base.deliveries.find { |e| e.to.first == "test@example.com" }
|
||||||
|
assert_not_nil email
|
||||||
assert_equal 1, email.to.length
|
assert_equal 1, email.to.length
|
||||||
assert_equal "[OpenStreetMap] pulibc_test2 has commented on a changeset you are interested in", email.subject
|
assert_equal "[OpenStreetMap] pulibc_test2 has commented on a changeset you are interested in", email.subject
|
||||||
assert_equal "test@example.com", email.to.first
|
|
||||||
|
|
||||||
ActionMailer::Base.deliveries.clear
|
ActionMailer::Base.deliveries.clear
|
||||||
end
|
end
|
||||||
|
|
|
@ -258,15 +258,15 @@ class NotesControllerTest < ActionController::TestCase
|
||||||
assert_equal "This is an additional comment", js["properties"]["comments"].last["text"]
|
assert_equal "This is an additional comment", js["properties"]["comments"].last["text"]
|
||||||
assert_nil js["properties"]["comments"].last["user"]
|
assert_nil js["properties"]["comments"].last["user"]
|
||||||
|
|
||||||
email = ActionMailer::Base.deliveries.first
|
email = ActionMailer::Base.deliveries.find { |e| e.to.first == "test@openstreetmap.org" }
|
||||||
|
assert_not_nil email
|
||||||
assert_equal 1, email.to.length
|
assert_equal 1, email.to.length
|
||||||
assert_equal "[OpenStreetMap] An anonymous user has commented on one of your notes", email.subject
|
assert_equal "[OpenStreetMap] An anonymous user has commented on one of your notes", email.subject
|
||||||
assert_equal "test@openstreetmap.org", email.to.first
|
|
||||||
|
|
||||||
email = ActionMailer::Base.deliveries.second
|
email = ActionMailer::Base.deliveries.find { |e| e.to.first == "public@OpenStreetMap.org" }
|
||||||
|
assert_not_nil email
|
||||||
assert_equal 1, email.to.length
|
assert_equal 1, email.to.length
|
||||||
assert_equal "[OpenStreetMap] An anonymous user has commented on a note you are interested in", email.subject
|
assert_equal "[OpenStreetMap] An anonymous user has commented on a note you are interested in", email.subject
|
||||||
assert_equal "public@OpenStreetMap.org", email.to.first
|
|
||||||
|
|
||||||
get :show, :id => notes(:note_with_comments_by_users).id, :format => "json"
|
get :show, :id => notes(:note_with_comments_by_users).id, :format => "json"
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
@ -300,15 +300,16 @@ class NotesControllerTest < ActionController::TestCase
|
||||||
assert_equal "This is an additional comment", js["properties"]["comments"].last["text"]
|
assert_equal "This is an additional comment", js["properties"]["comments"].last["text"]
|
||||||
assert_equal "test2", js["properties"]["comments"].last["user"]
|
assert_equal "test2", js["properties"]["comments"].last["user"]
|
||||||
|
|
||||||
email = ActionMailer::Base.deliveries.first
|
email = ActionMailer::Base.deliveries.find { |e| e.to.first == "test@openstreetmap.org" }
|
||||||
|
assert_not_nil email
|
||||||
assert_equal 1, email.to.length
|
assert_equal 1, email.to.length
|
||||||
assert_equal "[OpenStreetMap] test2 has commented on one of your notes", email.subject
|
assert_equal "[OpenStreetMap] test2 has commented on one of your notes", email.subject
|
||||||
assert_equal "test@openstreetmap.org", email.to.first
|
assert_equal "test@openstreetmap.org", email.to.first
|
||||||
|
|
||||||
email = ActionMailer::Base.deliveries.second
|
email = ActionMailer::Base.deliveries.find { |e| e.to.first == "public@OpenStreetMap.org" }
|
||||||
|
assert_not_nil email
|
||||||
assert_equal 1, email.to.length
|
assert_equal 1, email.to.length
|
||||||
assert_equal "[OpenStreetMap] test2 has commented on a note you are interested in", email.subject
|
assert_equal "[OpenStreetMap] test2 has commented on a note you are interested in", email.subject
|
||||||
assert_equal "public@OpenStreetMap.org", email.to.first
|
|
||||||
|
|
||||||
get :show, :id => notes(:note_with_comments_by_users).id, :format => "json"
|
get :show, :id => notes(:note_with_comments_by_users).id, :format => "json"
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue