Skip to content

Instantly share code, notes, and snippets.

@doug7410
Created July 28, 2014 20:14
Show Gist options
  • Save doug7410/eadb5f6a27ed8bd5dcc3 to your computer and use it in GitHub Desktop.
Save doug7410/eadb5f6a27ed8bd5dcc3 to your computer and use it in GitHub Desktop.
video_controller_spec
require 'spec_helper'
describe VideosController do
describe "GET show" do
it "sets the requested video to @video" do
video = Video.create(title: "Game of Thrones", description: "A very awesome show!")
get :show, id: video.id
assigns(:video) == video
end
it "renders the show template" do
user = User.create(email: "[email protected]", password: "abc123", full_name: "doug s")
session[:user_id] = user.id
video = Video.create(title: "Game of Thrones", description: "A very awesome show!")
get :show, id: video.id
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