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
    
  
  
    
  | class MoviesController < ApplicationController | |
| #some code | |
| def update | |
| @movie = Movie.find params[:id] | |
| @movie.update_attributes!(movie_params) | |
| flash[:notice] = "#{@movie.title} was successfully updated." | |
| redirect_to movie_path(@movie) | |
| end | 
  
    
      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
    
  
  
    
  | class MoviesController < ApplicationController | |
| #some code | |
| def destroy | |
| @movie = Movie.find(params[:id]) | |
| @movie.destroy | |
| flash[:notice] = "Movie '#{@movie.title}' deleted." | |
| redirect_to movies_path | |
| end | 
  
    
      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 | |
| describe "POST #create" do | |
| context "with valid attributes" do | |
| it "saves the new movie in the database" do | |
| end | |
| it "assigns the saved movie to @movie" do | |
| end | |
| it "redirects to the home page" do | 
  
    
      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 | |
| describe "POST #create" do | |
| it "saves the new movie in the database" do | |
| end | |
| it "assigns the saved movie to @movie" do | |
| end | |
| it "redirects to the home page" do | 
  
    
      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
    
  
  
    
  | 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 | 
  
    
      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 "POST #create" do | |
  
    
      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
    
  
  
    
  | FactoryGirl.define do | |
| factory :movie do | |
| id '1' | |
| title 'Blazing Saddles' | |
| rating 'R' | |
| release_date '7/2/1974' | |
| end | |
| end | 
  
    
      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_relative '../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 "POST #create" do | |
| context "with valid attributes" do | 
  
    
      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 | |
| describe "GET #show" do | |
| it "assigns the requested movie to @movie" do | |
| end | |
| it "renders the :show template" do | |
| end | |
  
    
      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 | |