RSpec / RSpec Rails / Docs
3.1.0 / 2014-09-04
3.1.0 / 2014-09-04
Enhancements:
- Switch to using the
have_http_statusmatcher in spec generators. (Aaron Kromer, #1086) - Update
rails_helpergenerator to allow users to opt-in to auto-loadingspec/supportfiles instead of forcing it upon them. (Aaron Kromer, #1137) - Include generator for
ActiveJob. (Abdelkader Boudih, #1155) - Improve support for non-ActiveRecord apps by not loading ActiveRecord related settings in the generated
rails_helper. (Aaron Kromer, #1150) - Remove Ruby warnings as a suggested configuration. (Aaron Kromer, #1163)
Bug Fixes:
- Fix controller route lookup for Rails 4.2. (Tomohiro Hashidate, #1142)
3.0.2 / 2014-07-21
Bug Fixes:
- Suppress warning in
SetupAndTeardownAdapter. (André Arko, #1085) - Remove dependency on Rubygems. (Andre Arko & Doc Riteze, #1099)
- Standardize controller spec template style. (Thomas Kriechbaumer, #1122)
3.0.1 / 2014-06-02
Bug Fixes:
- Fix missing require in
rails g rspec:install. (Sam Phippen, #1058)
3.0.0 / 2014-06-01
Enhancements:
- Separate RSpec configuration in generated
spec_helperfrom Rails setup and associated configuration options. Moving Rails specific settings and options torails_helper. (Aaron Kromer)
Bug Fixes:
- Fix an issue with fixture support when
ActiveRecordisn't loaded. (Jon Rowe)
3.0.0.rc1 / 2014-05-18
Breaking Changes for 3.0.0:
- Extracts the
mock_modelandstub_modelmethods to therspec-activemodel-mocksgem. (Thomas Holmes) - Spec types are no longer inferred by location, they instead need to be explicitly tagged. The old behaviour is enabled by
config.infer_spec_type_from_file_location!, which is still supplied in the default generatedspec_helper.rb. (Xavier Shay, Myron Marston) controllermacro in controller specs no longer mutates:described_classmetadata. It still overrides the subject and sets the controller, though. (Myron Marston)- Stop depending on or requiring
rspec-collection_matchers. Users who want those matchers should add the gem to their Gemfile and require it themselves. (Myron Marston) - Removes runtime dependency on
ActiveModel. (Rodrigo Rosenfeld Rosas)
Enhancements:
- Supports Rails 4.x reference attribute ids in generated scaffold for view specs. (Giovanni Cappellotto)
- Add
have_http_statusmatcher. (Aaron Kromer) - Add spec type metadata to generator templates. (Aaron Kromer)
Bug Fixes:
- Fix an inconsistency in the generated scaffold specs for a controller. (Andy Waite)
- Ensure
config.before(:all, :type => <type>)hooks run before groups of the given type, even when the type is inferred by the file location. (Jon Rowe, Myron Marston) - Switch to parsing params with
Rack::Utils::parse_nested_queryto match Rails. (Tim Watson) - Fix incorrect namespacing of anonymous controller routes. (Aaron Kromer)
3.0.0.beta2 / 2014-02-17
Breaking Changes for 3.0.0:
- Removes the
--webratoption for the request spec generator (Andy Lindeman) - Methods from
Capybara::DSL(e.g.,visit) are no longer available in controller specs. It is more appropriate to use capybara in feature specs (spec/features) instead. (Andy Lindeman) infer_base_class_for_anonymous_controllersis enabled by default. (Thomas Holmes)- Capybara 2.2.0 or above is required for feature specs. (Andy Lindeman)
Enhancements:
- Improve
be_validmatcher for non-ActiveModel::Errors implementations (Ben Hamill)
Bug Fixes:
- Use
__send__rather thansendto prevent naming collisions (Bradley Schaefer) - Supports Rails 4.1. (Andy Lindeman)
- Routes are drawn correctly for anonymous controllers with abstract parents. (Billy Chan)
- Loads ActiveSupport properly to support changes in Rails 4.1. (Andy Lindeman)
- Anonymous controllers inherit from
ActionController::BaseifApplicationControlleris not present. (Jon Rowe) - Require
rspec/collection_matcherswhenrspec/railsis required. (Yuji Nakayama)
3.0.0.beta1 / 2013-11-07
Breaking Changes for 3.0.0:
- Extracts
autotestandautotest-railssupport torspec-autotestgem. (Andy Lindeman)
2.99.0 / 2014-06-01
No changes. Just taking it out of pre-release.
2.99.0.rc1 / 2014-05-18
Deprecations
- Deprecates
stub_modelandmock_modelin favor of therspec-activemodel-mocksgem. (Thomas Holmes) - Issue a deprecation to instruct users to configure
config.infer_spec_type_from_file_location!during the upgrade process since spec type inference is opt-in in 3.0. (Jon Rowe) - Issue a deprecation when
described_classis accessed in a controller example group that has used thecontroller { }macro to generate an anonymous controller class, since in 2.x,described_classwould return that generated class but in 3.0 it will continue returning the class passed todescribe. (Myron Marston)
2.99.0.beta2 / 2014-02-17
Deprecations:
- Deprecates the
--webratoption to the scaffold and request spec generator (Andy Lindeman) - Deprecates the use of
Capybara::DSL(e.g.,visit) in controller specs. It is more appropriate to use capybara in feature specs (spec/features) instead. (Andy Lindeman)
Bug Fixes:
- Use
__send__rather thansendto prevent naming collisions (Bradley Schaefer) - Supports Rails 4.1. (Andy Lindeman)
- Loads ActiveSupport properly to support changes in Rails 4.1. (Andy Lindeman)
- Anonymous controllers inherit from
ActionController::BaseifApplicationControlleris not present. (Jon Rowe)
2.99.0.beta1 / 2013-11-07
Deprecations:
- Deprecates autotest integration in favor of the
rspec-autotestgem. (Andy Lindeman)
Enhancements:
- Supports Rails 4.1 and Minitest 5. (Patrick Van Stee)
Bug Fixes:
- Fixes "warning: instance variable @orig\_routes not initialized" raised by controller specs when
--warningsare enabled. (Andy Lindeman) - Where possible, check against the version of ActiveRecord, rather than Rails. It is possible to use some of rspec-rails without all of Rails. (Darryl Pogue)
- Explicitly depends on
activemodel. This allows libraries that do not bring in all ofrailsto userspec-rails. (John Firebaugh)
2.14.1 / 2013-12-29
Bug Fixes:
- Fixes "warning: instance variable @orig\_routes not initialized" raised by controller specs when
--warningsare enabled. (Andy Lindeman) - Where possible, check against the version of ActiveRecord, rather than Rails. It is possible to use some of rspec-rails without all of Rails. (Darryl Pogue)
- Supports Rails 4.1 and Minitest 5. (Patrick Van Stee, Andy Lindeman)
- Explicitly depends on
activemodel. This allows libraries that do not bring in all ofrailsto userspec-rails. (John Firebaugh) - Use
__send__rather thansendto prevent naming collisions (Bradley Schaefer)
2.14.0 / 2013-07-06
Bug fixes
- Rake tasks do not define methods that might interact with other libraries. (Fujimura Daisuke)
- Reverts fix for out-of-order
letdefinitions in controller specs after the issue was fixed upstream in rspec-core. (Andy Lindeman) - Fixes deprecation warning when using
expect(Model).to have(n).recordswith Rails 4. (Andy Lindeman)
2.14.0.rc1 / 2013-05-27
Enhancements
- Prelimiarily support Rails 4.1 by updating adapters to support Minitest 5.0. (Andy Lindeman)
Bug fixes
rake statsruns correctly when spec files exist at the top level of the spec/ directory. (Benjamin Fleischer)
2.13.2 / 2013-05-18
Bug fixes
letdefinitions may override methods defined in modules brought in viaconfig.includein controller specs. Fixes regression introduced in 2.13. (Andy Lindeman, Jon Rowe)- Code that checks Rails version numbers is more robust in cases where Rails is not fully loaded. (Andy Lindeman)
Enhancements
- Document how the spec/support directory works. (Sam Phippen)
2.13.1 / 2013-04-27
Bug fixes
- View specs are no longer generated if no template engine is specified (Kevin Glowacz)
ActionController::Base.allow_forgery_protectionis set to its original value after each example. (Mark Dimas)patchis supported in routing specs. (Chris Your)- Routing assertions are supported in controller specs in Rails 4. (Andy Lindeman)
- Fix spacing in the install generator template (Taiki ONO)
2.13.0 / 2013-02-23
Enhancements
be_validmatcher includes validation error messages. (Tom Scott)- Adds cucumber scenario showing how to invoke an anonymous controller's non-resourceful actions. (Paulo Luis Franchini Casaretto)
- Null template handler is used when views are stubbed. (Daniel Schierbeck)
- The generated
spec_helper.rbin Rails 4 includes a check for pending migrations. (Andy Lindeman) - Adds
rake spec:featurestask. (itzki) - Rake tasks are automatically generated for each spec/ directory. (Rudolf Schmidt)
2.12.2 / 2013-01-12
Bug fixes
- Reverts earlier fix where anonymous controllers defined the
_routesmethod to support testing of redirection and generation of URLs from other contexts. The implementation ended up breaking the ability to refer to non-anonymous routes in the context of the controller under test. - Uses
assert_selectcorrectly in view specs generated by scaffolding. (Andy Lindeman)
2.12.1 / 2013-01-07
Bug fixes
- Operates correctly when ActiveRecord is only partially loaded (e.g., with older versions of Mongoid). (Eric Marden)
expect(subject).to have(...).errors_onoperates correctly for ActiveResource models wherevalid?does not accept an argument. (Yi Wen)- Rails 4 support for routing specs. (Andy Lindeman)
- Rails 4 support for
ActiveRecord::Relationand the=~operator matcher. (Andy Lindeman) - Anonymous controllers define
_routesto support testing of redirection and generation of URLs from other contexts. (Andy Lindeman)
2.12.0 / 2012-11-12
Enhancements
- Support validation contexts when using
#errors_on(Woody Peterson) - Include RequestExampleGroup in groups in spec/api
Bug fixes
- Add
shouldandshould_nottoCollectionProxy(Rails 3.1+) andAssociationProxy(Rails 3.0). (Myron Marston) controller.controller_pathis set correctly for view specs in Rails 3.1+. (Andy Lindeman)- Generated specs support module namespacing (e.g., in a Rails engine). (Andy Lindeman)
renderproperly infers the view to be rendered in Rails 3.0 and 3.1 (John Firebaugh)- AutoTest mappings involving config/ work correctly (Brent J. Nordquist)
- Failures message for
be_new_recordare more useful (Andy Lindeman)
2.11.4 / 2012-10-14
Capybara-2.0 integration support:
- include RailsExampleGroup in spec/features (necessary when there is no AR)
- include Capybara::DSL and Capybara::RSpecMatchers in spec/features