Project

General

Profile

« Previous | Next » 

Revision 85a97146

Added by Dominic Cleal about 8 years ago

fixes #13244 - update Rails to 4.2.6

- Add responders gem to support class-level respond_to usage
- http://edgeguides.rubyonrails.org/4_2_release_notes.html#respond-with-class-level-respond-to
- Replace foreigner with native Rails 4.2 FK support
- uses a patch from Rails 5 to support Foreigner's
`foreign_key_exists?` helper for full compatibility
- `foreign_keys` should be avoided in favour of the higher level
methods as it throws a NotImplementedError on sqlite3
- Update DB adapter versions to match ActiveRecord
- Enable exceptions from after_commit handlers to detect more errors
- Change deprecated application config settings
- Remove test:lib chaining on rake test task
- 4.2 runs lib tasks automatically now, as test:run is redefined
to all _test files within test/ rather than units+functionals.
The task is still needed for the jenkins:* tasks.
- Fix deprecation of mailer #deliver method, change to #deliver_now
- Change CSRF test to use generated, not static tokens
- 4.2 changes CSRF tokens to be different on every request and
validated against the session, so use its generator to test the
controller behaviour instead of hardcoding tokens.
- Change test execution order to random

View differences:

test/unit/host_mailer_test.rb
end
test "mail should have the specified recipient" do
assert HostMailer.summary(@options).deliver.to.include?("admin@someware.com")
assert HostMailer.summary(@options).deliver_now.to.include?("admin@someware.com")
end
test "mail should have a subject" do
assert !HostMailer.summary(@options).deliver.subject.empty?
assert !HostMailer.summary(@options).deliver_now.subject.empty?
end
test "mail should have a body" do
assert !HostMailer.summary(@options).deliver.body.empty?
assert !HostMailer.summary(@options).deliver_now.body.empty?
end
test "mail should report at least one host" do
assert HostMailer.summary(@options).deliver.body.include?(@host.name)
assert HostMailer.summary(@options).deliver_now.body.include?(@host.name)
end
test "mail should report disabled hosts" do
@host.enabled = false
@host.save
assert HostMailer.summary(@options).deliver.body.include?(@host.name)
assert HostMailer.summary(@options).deliver_now.body.include?(@host.name)
end
test 'error_state sends mail with correct headers' do
report = FactoryGirl.create(:report)
user = FactoryGirl.create(:user, :with_mail)
mail = HostMailer.error_state(report, :user => user).deliver
mail = HostMailer.error_state(report, :user => user).deliver_now
assert_includes mail.from, Setting["email_reply_address"]
assert_includes mail.to, user.mail
assert_includes mail.subject, report.host.name

Also available in: Unified diff