Switch branches/tags
Find file History
Latest commit ebd25b4 Nov 16, 2017 @cbliard cbliard committed with JonRowe Improve doc about Job specs & Rails versions matrix (#1886)
* Improve doc about Job specs & rails versions matrix

* Add System specs information in doc

* doc: add links from directory structure feature to other features

* doc: simpler links to other features
Permalink
..
Failed to load latest commit information.
controller_specs
feature_specs Get cukes passing on 5.1 Mar 25, 2017
helper_specs update or add wording indicating the use of `:type` tagging and our p… Oct 16, 2014
job_specs Adds documentation and feature for job specs (#1725) Oct 18, 2016
mailer_specs
matchers Get cukes passing on 5.1 Mar 25, 2017
model_specs use new rspec-mocks feature to verify active_record columns Jan 18, 2015
request_specs
routing_specs update or add wording indicating the use of `:type` tagging and our p… Oct 16, 2014
step_definitions Adds documentation and feature for job specs (#1725) Oct 18, 2016
support Resolves issue #1044. Adding custom content types to feature, request… Aug 1, 2015
system_specs Integrate with ActionDispatch::SystemTest (#1813) Aug 26, 2017
upgrade Note extract of `stub_model` and `mock_model`. Jul 8, 2014
view_specs
.nav Add option to add rails gems to exclusion filters Sep 18, 2015
Generators.md [Generators] Added generator for ActiveJob Aug 27, 2014
GettingStarted.md Fix warning in generate example of Getting Started Oct 15, 2015
README.md Remove trailing whitespace to fix build. (#1775) Jan 15, 2017
RailsVersions.md Improve doc about Job specs & Rails versions matrix (#1886) Nov 15, 2017
Transactions.md add whitespace checks and fix end of line whitespace Aug 1, 2015
backtrace_filtering.feature Add option to add rails gems to exclusion filters Sep 18, 2015
directory_structure.feature Improve doc about Job specs & Rails versions matrix (#1886) Nov 15, 2017
file_fixture.feature Add support for file fixture available in Rails 5 Apr 5, 2016

README.md

rspec-rails extends Rails' built-in testing framework to support rspec examples for requests, controllers, models, views, helpers, mailers and routing.

Rails

rspec-rails 3 supports Rails 3.x and 4.x. For earlier versions of Rails, you need rspec-rails 1. For Rails 5.x, make sure you are using rspec-rails 3.5.0 or newer.

Install

gem install rspec-rails

This installs the following gems:

rspec
rspec-core
rspec-expectations
rspec-mocks
rspec-rails

Configure

Add rspec-rails to the :test and :development groups in the Gemfile:

group :test, :development do
  gem 'rspec-rails', '~> 3.0.0'
end

It needs to be in the :development group to expose generators and rake tasks without having to type RAILS_ENV=test.

Now you can run:

script/rails generate rspec:install

This adds the spec directory and some skeleton files, including a .rspec file.

Issues

The documentation for rspec-rails is a work in progress. We'll be adding Cucumber features over time, and clarifying existing ones. If you have specific features you'd like to see added, find the existing documentation incomplete or confusing, or, better yet, wish to write a missing Cucumber feature yourself, please submit an issue or a pull request.