Skip to content

Instantly share code, notes, and snippets.

@lkrych
Last active October 18, 2016 14:48
Show Gist options
  • Save lkrych/e321f52cf63ff9f4d8c1c944e50cd4aa to your computer and use it in GitHub Desktop.
Save lkrych/e321f52cf63ff9f4d8c1c944e50cd4aa to your computer and use it in GitHub Desktop.
How to specify a mock in rspec
RSpec.describe MoviesController, type: :controller do
before (:each) do
@mock_movie_attributes = {:title => 'Space Balls', :release_date => '24/6/1987', :rating => 'PG'}
@mock_movie = FactoryGirl.create(:movie)
end
### All the unit tests
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment