Skip to content

Instantly share code, notes, and snippets.

@lkrych
Created October 17, 2016 17:09
Show Gist options
  • Save lkrych/354483503b3a87a6c9ad197f832b490b to your computer and use it in GitHub Desktop.
Save lkrych/354483503b3a87a6c9ad197f832b490b to your computer and use it in GitHub Desktop.
How to begin testing the movies_controller
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
end
end
end
describe "GET #show" do
it "assigns the requested movie to @movie" do
end
it "renders the :show template" do
end
end
describe "PUT #update" do
it "located the requested movie" do
end
it "changed the requested movies attributes" do
end
it "redirects to the updated movie" do
end
end
describe "DELETE #destroy" do
it "deletes the movie" do
end
it "redirects to the main page " do
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment