3.2.1 / 2015-02-23
Bug Fixes:
- Add missing
require
to RSpec generator root fixing an issue where Rail's autoload does not find it in some environments. (Aaron Kromer, #1305) be_routable
matcher now has the correct description. (Tony Ta, #1310)- Fix dependency to allow Rails 4.2.x patches / pre-releases (Lucas Mazza, #1318)
- Disable the
test-unit
gem's autorunner on projects running Rails < 4.1 and Ruby < 2.2 (Aaron Kromer, #1320)
3.2.0 / 2015-02-03
Enhancements:
- Include generator for
ActionMailer
mailer previews (Takashi Nakagawa, #1185) - Configure the
ActionMailer
preview path via a Railtie (Aaron Kromer, #1236) - Show all RSpec generators when running
rails generate
(Eliot Sykes, #1248) - Support Ruby 2.2 with Rails 3.2 and 4.x (Aaron Kromer, #1264, #1277)
- Improve
instance_double
to support verifying dynamic column methods defined byActiveRecord
(Jon Rowe, #1238) - Mirror the use of Ruby 1.9 hash syntax for the
type
tags in the spec generators on Rails 4. (Michael Stock, #1292)
Bug Fixes:
- Fix
rspec:feature
generator to useRSpec
namespace preventing errors when monkey-patching is disabled. (Rebecca Skinner, #1231) - Fix
NoMethodError
caused by callingRSpec.feature
when Capybara is not available or the Capybara version is < 2.4.0. (Aaron Kromer, #1261) - Fix
ArgumentError
when using an anonymous controller which inherits an outer group's anonymous controller. (Yuji Nakayama, #1260) - Fix "Test is not a class (TypeError)" error when using a custom
Test
class in Rails 4.1 and 4.2. (Aaron Kromer, #1295)
3.1.0 / 2014-09-04
Enhancements:
- Switch to using the
have_http_status
matcher in spec generators. (Aaron Kromer, #1086) - Update
rails_helper
generator to allow users to opt-in to auto-loadingspec/support
files 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)
- Improve the semantics of the controller spec for scaffolds. (Griffin Smith, #1204)
- Use
#method
syntax in all generated controller specs. (Griffin Smith, #1206)
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_helper
from 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
ActiveRecord
isn't loaded. (Jon Rowe)
3.0.0.rc1 / 2014-05-18
Breaking Changes for 3.0.0:
- Extracts the
mock_model
andstub_model
methods to therspec-activemodel-mocks
gem. (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) controller
macro in controller specs no longer mutates:described_class
metadata. 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_status
matcher. (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_query
to 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
--webrat
option 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_controllers
is enabled by default. (Thomas Holmes)- Capybara 2.2.0 or above is required for feature specs. (Andy Lindeman)
Enhancements:
- Improve
be_valid
matcher for non-ActiveModel::Errors implementations (Ben Hamill)
Bug Fixes:
- Use
__send__
rather thansend
to 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::Base
ifApplicationController
is not present. (Jon Rowe) - Require
rspec/collection_matchers
whenrspec/rails
is required. (Yuji Nakayama)
3.0.0.beta1 / 2013-11-07
Breaking Changes for 3.0.0:
- Extracts
autotest
andautotest-rails
support torspec-autotest
gem. (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_model
andmock_model
in favor of therspec-activemodel-mocks
gem. (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_class
is accessed in a controller example group that has used thecontroller { }
macro to generate an anonymous controller class, since in 2.x,described_class
would 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
--webrat
option 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 thansend
to 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::Base
ifApplicationController
is not present. (Jon Rowe)
2.99.0.beta1 / 2013-11-07
Deprecations:
- Deprecates autotest integration in favor of the
rspec-autotest
gem. (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
--warnings
are 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 ofrails
to 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
--warnings
are 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 ofrails
to userspec-rails
. (John Firebaugh) - Use
__send__
rather thansend
to 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
let
definitions in controller specs after the issue was fixed upstream in rspec-core. (Andy Lindeman) - Fixes deprecation warning when using
expect(Model).to have(n).records
with 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 stats
runs correctly when spec files exist at the top level of the spec/ directory. (Benjamin Fleischer)
2.13.2 / 2013-05-18
Bug fixes
let
definitions may override methods defined in modules brought in viaconfig.include
in 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_protection
is set to its original value after each example. (Mark Dimas)patch
is 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_valid
matcher 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.rb
in Rails 4 includes a check for pending migrations. (Andy Lindeman) - Adds
rake spec:features
task. (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
_routes
method 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_select
correctly 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_on
operates 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::Relation
and the=~
operator matcher. (Andy Lindeman) - Anonymous controllers define
_routes
to 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
should
andshould_not
toCollectionProxy
(Rails 3.1+) andAssociationProxy
(Rails 3.0). (Myron Marston) controller.controller_path
is set correctly for view specs in Rails 3.1+. (Andy Lindeman)- Generated specs support module namespacing (e.g., in a Rails engine). (Andy Lindeman)
render
properly 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_record
are 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
See https://github.com/jnicklas/capybara/pull/809 and http://rubydoc.info/gems/rspec-rails/file/Capybara.md for background.
2.11.1, .2, .3 were yanked due to errant documentation.
2.11.0 / 2012-07-07
Enhancements
- The generated
spec/spec_helper.rb
setsconfig.order = "random"
so that specs run in random order by default. - rename
render_template
tohave_rendered
(and alias torender_template
for backward compatibility) - The controller spec generated with
rails generate scaffold namespaced::model
matches the spec generated withrails generate scaffold namespaced/model
(Kohei Hasegawa)
Bug fixes
- "uninitialized constant" errors are avoided when using using gems like
rspec-rails-uncommitted
that defineRspec::Rails
beforerspec-rails
loads (Andy Lindeman)
2.10.1 / 2012-05-03
Bug fixes
- fix regression introduced in 2.10.0 that broke integration with Devise (https://github.com/rspec/rspec-rails/issues/534)
- remove generation of helper specs when running the scaffold generator, as Rails already does this (Jack Dempsey)
2.10.0 / 2012-05-03
Bug fixes
render_views
called in a spec can now override the config setting. (martinsvalin)- Fix
render_views
for anonymous controllers on 1.8.7. (hudge, mudge) - Eliminate use of deprecated
process_view_paths
- Fix false negatives when using
route_to
matcher withshould_not
controller
is no longer nil inconfig.before
hooks- Change
request.path_parameters
keys to symbols to match real Rails environment (Nathan Broadbent) - Silence deprecation warnings in pre-2.9 generated view specs (Jonathan del Strother)
2.9.0 / 2012-03-17
Enhancements
- add description method to RouteToMatcher (John Wulff)
- Run "db:test:clone_structure" instead of "db:test:prepare" if Active Record's schema format is ":sql". (Andrey Voronkov)
Bug fixes
mock_model(XXX).as_null_object.unknown_method
returns self again- Generated view specs use different IDs for each attribute.
2.8.1 / 2012-01-04
NOTE: there was a change in rails-3.2.0.rc2 which broke compatibility with stub_model in rspec-rails. This release fixes that issue, but it means that you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >= 3.2.0.rc2.
- Bug fixes
- Explicitly stub valid? in stub_model. Fixes stub_model for rails versions >= 3.2.0.rc2.
2.8.0 / 2012-01-04
- Enhancements
- Eliminate deprecation warnings in generated view specs in Rails 3.2
- Ensure namespaced helpers are included automatically (Evgeniy Dolzhenko)
- Added cuke scenario documenting which routes are generated for anonymous controllers (Alan Shields)
2.8.0.rc2 / 2011-12-19
Enhancements
- Add session hash to generated controller specs (Thiago Almeida)
- Eliminate deprecation warnings about InstanceMethods modules in Rails 3.2
Bug fixes
- Stub attribute accessor after
respond_to?
call on mocked model (Igor Afonov)
- Stub attribute accessor after
2.8.0.rc1 / 2011-11-06
Enhancements
- Removed unnecessary "config.mock_with :rspec" from spec_helper.rb (Paul Annesley)
Changes
- No API changes for rspec-rails in this release, but some internals changed to align with rspec-core-2.8
2.7.0 / 2011-10-16
Enhancements
ActiveRecord::Relation
can use the=~
matcher (Andy Lindeman)- Make generated controller spec more consistent with regard to ids (Brent J. Nordquist)
- Less restrictive autotest mapping between spec and implementation files (José Valim)
require 'rspec/autorun'
from generatedspec_helper.rb
(David Chelimsky)- add
bypass_rescue
(Lenny Marks) route_to
accepts query string (Marc Weil)
Internal
- Added specs for generators using ammeter (Alex Rothenberg)
Bug fixes
- Fix configuration/integration bug with rails 3.0 (fixed in 3.1) in which
fixure_file_upload
reads fromActiveSupport::TestCase.fixture_path
and misses RSpec's configuration (David Chelimsky) - Support nested resource in view spec generator (David Chelimsky)
- Define
primary_key
on class generated bymock_model("WithAString")
(David Chelimsky)
- Fix configuration/integration bug with rails 3.0 (fixed in 3.1) in which
2.6.1 / 2011-05-25
This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
- Bug fixes
- fix controller specs with anonymous controllers with around filters
- exclude spec directory from rcov metrics (Rodrigo Navarro)
- guard against calling prerequisites on nil default rake task (Jack Dempsey)
2.6.0 / 2011-05-12
Enhancements
- rails 3 shortcuts for routing specs (Joe Fiorini)
- support nested resources in generators (Tim McEwan)
- require 'rspec/rails/mocks' to use
mock_model
without requiring the whole rails framework - Update the controller spec generated by the rails scaffold generator:
- Add documentation to the generated spec
- Use
any_instance
to avoid stubbing finders - Use real objects instead of
mock_model
- Update capybara integration to work with capy 0.4 and 1.0.0.beta
- Decorate paths passed to
[append|prepend]_view_paths
with empty templates unless rendering views. (Mark Turner)
Bug fixes
- fix typo in "rake spec:statsetup" (Curtis Schofield)
- expose named routes in anonymous controller specs (Andy Lindeman)
- error when generating namespaced scaffold resources (Andy Lindeman)
- Fix load order issue w/ Capybara (oleg dashevskii)
- Fix monkey patches that broke due to internal changes in rails-3.1.0.beta1
2.5.0 / 2011-02-05
Enhancements
- use index_helper instead of table_name when generating specs (Reza Primardiansyah)
Bug fixes
- fixed bug in which
render_views
in a nested group set the value in its parent group. - only include MailerExampleGroup when it is defined (Steve Sloan)
- mock_model.as_null_object.attribute.blank? returns false (Randy Schmidt)
- fix typo in request specs (Paco Guzman)
- fixed bug in which
2.4.1 / 2011-01-03
- Bug fixes
- fixed bug caused by including some Rails modules before RSpec's RailsExampleGroup
2.4.0 / 2011-01-02
Enhancements
- include ApplicationHelper in helper object in helper specs
- include request spec extensions in files in spec/integration
- include controller spec extensions in groups that use :type => :controller
- same for :model, :view, :helper, :mailer, :request, :routing
Bug fixes
- restore global config.render_views so you only need to say it once
- support overriding render_views in nested groups
- matchers that delegate to Rails' assertions capture ActiveSupport::TestCase::Assertion (so they work properly now with should_not in Ruby 1.8.7 and 1.9.1)
Deprecations
- include_self_when_dir_matches
2.3.1 / 2010-12-16
- Bug fixes
- respond_to? correctly handles 2 args
- scaffold generator no longer fails on autotest directory
2.3.0 / 2010-12-12
- Changes
- Generator no longer generates autotest/autodiscover.rb, as it is no longer needed (as of rspec-core-2.3.0)
2.2.1 / 2010-12-01
Bug fixes
- Depend on railties, activesupport, and actionpack instead of rails (Piotr Solnica)
- Got webrat integration working properly across different types of specs
Deprecations
- --webrat-matchers flag for generators is deprecated. use --webrat instead.
2.2.0 / 2010-11-28
Enhancements
- Added stub_template in view specs
Bug fixes
- Properly include helpers in views (Jonathan del Strother)
- Fix bug in which method missing led to a stack overflow
- Fix stack overflow in request specs with open_session
- Fix stack overflow in any spec when method_missing was invoked
- Add gem dependency on rails ~> 3.0.0 (ensures bundler won't install rspec-rails-2 with rails-2 apps).
2.1.0 / 2010-11-07
Enhancements
- Move errors_on to ActiveModel to support other AM-compliant ORMs
Bug fixes
- Check for presence of ActiveRecord instead of checking Rails config (gets rspec out of the way of multiple ORMs in the same app)
2.0.1 / 2010-10-15
Enhancements
- Add option to not generate request spec (--skip-request-specs)
Bug fixes
- Updated the mock_[model] method generated in controller specs so it adds any stubs submitted each time it is called.
- Fixed bug where view assigns weren't making it to the view in view specs in Rails-3.0.1. (Emanuele Vicentini)
2.0.0 / 2010-10-10
Enhancements
- ControllerExampleGroup uses controller as the implicit subject by default (Paul Rosania)
- autotest mapping improvements (Andreas Neuhaus)
- more cucumber features (Justin Ko)
- clean up spec helper (Andre Arko)
- add assign(name, value) to helper specs (Justin Ko)
- stub_model supports primary keys other than id (Justin Ko)
- support choice between Webrat/Capybara (Justin Ko)
- support specs for 'abstract' subclasses of ActionController::Base (Mike Gehard)
- be_a_new matcher supports args (Justin Ko)
Bug fixes
- support T::U components in mailer and request specs (Brasten Sager)