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.
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
There were issues with activesupport 4 and Ruby 1.9.2: https://travis-ci.org/thoughtbot/clearance/jobs/9306920
* Change routes to use `get` instead of `match`. * Don't allow multiline strings for email format. * Rails 4 issues an exception when validates_format_of encounters regex that uses ^ and $ rather than /A and /Z. See this pull request: rails/rails#6569 * `sign_out` should use DELETE, not GET. * Remove irrelevant spec for testing regex. * Test against latest security-patched Rails versions.
…: 3.2.10, 3.1.9, 3.0.18
…ncies are in the gemspec, a gem's Gemfile should just use the gemspec method' best practice as stated by Yehuda