Skip to content

Lesson: set up your Rails Application to use rspec

pgwillia edited this page Apr 10, 2014 · 5 revisions

This Tutorial is known to work with hydra version 6.1.0, 6.2.0.
Please update this wiki to reflect any other versions that have been tested.

Goals

  • Set up a Rails application to use RSpec

Explanation

We strongly recommend building a habit of using Test Driven Development. Most people using Hydra use RSpec for Test Driven Development. Also, RSpec tests are required with any contributions to any of the core Hydra gems. Here's how to set up your Rails application to use RSpec for testing.

Steps

Step 1: Install the rspec and rspec-rails gems

Ensure your Gemfile includes rspec-rails, e.g.:

group :development, :test do
  gem "rspec-rails"
end

If you had to add rspec-rails, run bundle install

$ bundle install

Step 2: Run the rspec rails generator

On the Command line

rails generate rspec:install

Step 3: Commit your changes

git add .
git commit -m "added rspec"

Next Steps

Return to the Dive into Hydra page.

Clone this wiki locally