Created
          October 18, 2016 14:58 
        
      - 
      
- 
        Save lkrych/d56d8f1592b397bf58784def62bb7a9b to your computer and use it in GitHub Desktop. 
    Completed RSpec file for testing show functionality of movies_controller
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | require 'rails_helper' | |
| 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 | |
| describe "GET #show" do | |
| it "assigns the requested movie to @movie" do | |
| get :show, id: @mock_movie | |
| expect(assigns(:movie).title).to include("Blazing Saddles") | |
| end | |
| it "renders the :show template" do | |
| get :show, id: @mock_movie | |
| expect(response).to render_template(:show) | |
| end | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment