As a result: * In the ActionMailer initializer for the test app, we have to refer to the ActionMailer object itself to configure it instead of the app config. This was recommended in rspec/rspec-rails#1313. * We had to change the setup for rack_session_spec because RSpec now checks for mutation of arguments passed into spies.
The replacement spec does much the same as the features were doing before, but in a (hopefully) more maintainable manner. We generate a fresh rails app, install clearance, and run clearance's generated specs. I kept the acceptance spec in its own suite because the output of it is a bit odd and I wanted it separate from our usual tests. It will output the results of the generated specs followed by the result of the single acceptance spec.
To get the test suite to run in under 2.2, I: * Upgraded Cucumber to a version that supports Ruby 2.2 * Added 2.2.0 to our Travis Matrix (Sorry, Travis) * Excluded Rails 3.2 under Ruby 2.2 from appraisals as it is not supported by rails (yet). See: rails/rails#18306 Once that was done, it was discovered that Rails 4.0.x requires the `test-unit` gem under Ruby 2.2. Adding that gem allows the test suite to run there. With that in place, I found that the `deny_access` matcher was not negating as expected. This is because the test-unit gem raises a different error when an assertion failed. I have to catch this error in addition to the Minitest::Assertion error we were already catching.
These replace several cucumber features and allow for more of a unit test of generators. In the process of testing the generators with ammeter, a simplification was made to the install generator: `inject_into_class` already handles not duplicating this injection - we don't need to guard against it specifically.
* Fix deprecation warnings in the cookie matcher * Fix loading of the MiniTest runner (caused by requiring `rails/test_help`, which we didn't need anyway. * Remove wrapper around MiniTest::Assertion * Clean up requires in `spec_helper` and `env`. * Remove .rspec file as the settings in there are default * Add appraisals to version control per https://github.com/thoughtbot/appraisal#version-control
Most of the changes necessary here were test-suite-only issues. The lone production-impactful change was adding support for `ActionMailer#deliver_later` in the `PasswordsController`. This will automatically use the queue configured with Active Job in order to background the sending of email. With no queue configured, it will be delivered synchronously. The old `#deliver` method still works, but generates deprecation warnings. The rest of the changes were related to the test suite: * Add a Rails 4.2 appraisal * Update cucumber steps to remove unnecessary gems from generated apps. * Simplify appraisal dependencies thanks to the above. * Fixed `forgeries_controller_spec`. This is still a brittle way to test this functionality but at least it works across Rails versions. * Removed deprecation related to test suite ordering in the test app that is loaded. There remains a single (repeated) deprecation when running specs on 4.2 which comes from RSpec and will be addressed by upgrading to `rspec-rails` 3.1 (see [`rspec-rails` issue]. That work will be in a separate pull-request. [`rspec-rails` issue]: rspec/rspec-rails#1187
Rails 4.1 now includes jbuilder 2.0+ in its default gemfile. Move the jbuilder 1.2 dependency from the clearance `gemfile` into the appraisals for Rails < 4.1 and add jbuilder 2.0 to the Rails 4.1 appraisal. The sdoc dependency was also moved into the appraisal definitions because it is a dependency only because it is included in the rails default gemfile. This leaves the gemfile for development dependencies only. Renamed the `create_migration` method in the Clearance install generator because it was [conflicting with a method] that was added into the class hierarchy in Rails 4.1. : https://github.com/rails/rails/blob/master/railties/lib/rails/generators/migration.rb#L63
* Add Ruby 2.1 to travis configuration * Update Rails 3.2 and 4.0 appraisals to latest versions * Add I18n.enforce_available_locales setting to test app to avoid deprecation warning. * Add Rails 4.1.0.beta1 to appraisals * Test unit integration feature updated to account for differing test output under rails 4.1 * Update gems
Force `bundle install` in install step Travis will now runs `bundle install --deployment` if it detects that the project has `Gemfile.lock`. However, there's a problem in Bundler deployment install that cause it not installing `bundler` gem into `vendor/bundle` directory, which causes `require 'bundler'` to fail.