mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal "[eCookbook] New file", mail.subject
- assert mail.body.to_s.include?('testfile.txt')
+ assert mail.body.include?('testfile.txt')
end
def test_create_version_file
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert mail.subject.starts_with?("[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}]")
- assert mail.body.to_s.include?("Subject changed from #{old_subject} to #{new_subject}")
+ assert mail.body.include?("Subject changed from #{old_subject} to #{new_subject}")
end
def test_put_update_with_project_change
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
- assert mail.body.to_s.include?("Searchable field changed from 125 to New custom value")
+ assert mail.body.include?("Searchable field changed from 125 to New custom value")
end
def test_put_update_with_multi_custom_field_change
assert_equal 2, j.details.size
mail = ActionMailer::Base.deliveries.last
- assert mail.body.to_s.include?("Status changed from New to Assigned")
+ assert mail.body.include?("Status changed from New to Assigned")
# subject should contain the new status
assert mail.subject.include?("(#{ IssueStatus.find(2).name })")
end
assert_equal User.anonymous, j.user
mail = ActionMailer::Base.deliveries.last
- assert mail.body.to_s.include?(notes)
+ assert mail.body.include?(notes)
end
def test_put_update_with_note_and_spent_time
assert_equal 59, File.size(attachment.diskfile)
mail = ActionMailer::Base.deliveries.last
- assert mail.body.to_s.include?('testfile.txt')
+ assert mail.body.include?('testfile.txt')
end
def test_put_update_with_failure_should_save_attachments
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] Test created message", mail.subject
- assert mail.body.to_s.include?('Message body')
+ assert mail.body.include?('Message body')
# author
assert mail.bcc.include?('jsmith@somenet.foo')
# project member
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal [user.mail], mail.bcc
- assert mail.body.to_s.include?('secret')
+ assert mail.body.include?('secret')
end
def test_create_with_failure
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal ['foo.bar@somenet.foo'], mail.bcc
- assert mail.body.to_s.include?(ll('fr', :notice_account_activated))
+ assert mail.body.include?(ll('fr', :notice_account_activated))
end
def test_update_with_password_change_should_send_a_notification
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal [u.mail], mail.bcc
- assert mail.body.to_s.include?('newpass')
+ assert mail.body.include?('newpass')
end
test "put :update with a password change to an AuthSource user switching to Internal authentication" do
assert_equal 1, ActionMailer::Base.deliveries.size
mail = last_email
assert mail.bcc.include?('dlopper@somenet.foo')
- assert mail.body.to_s.include?('Bug #3: Error 281 when updating a recipe')
+ assert mail.body.include?('Bug #3: Error 281 when updating a recipe')
assert_equal '1 issue(s) due in the next 42 days', mail.subject
end
assert_equal 1, ActionMailer::Base.deliveries.size # No mail for dlopper
mail = last_email
assert mail.bcc.include?('dlopper@somenet.foo')
- assert mail.body.to_s.include?('Bug #3: Error 281 when updating a recipe')
+ assert mail.body.include?('Bug #3: Error 281 when updating a recipe')
end
def last_email
user.language = 'fr'
Mailer.deliver_account_activated(user)
mail = last_email
- assert mail.body.to_s.include?('Votre compte')
+ assert mail.body.include?('Votre compte')
assert_equal :it, current_language
end
assert_not_nil mail
assert mail.subject.starts_with?(
"[#{fixed_issue.project.name} - #{fixed_issue.tracker.name} ##{fixed_issue.id}]")
- assert mail.body.to_s.include?(
+ assert mail.body.include?(
"Status changed from #{old_status} to #{fixed_issue.status}")
# ignoring commits referencing an issue of another project