Skip to content

Instantly share code, notes, and snippets.

@itsbth
Created January 21, 2012 16:54
Show Gist options
  • Select an option

  • Save itsbth/1653273 to your computer and use it in GitHub Desktop.

Select an option

Save itsbth/1653273 to your computer and use it in GitHub Desktop.
Uploaded by UploadToGist for Sublime Text 2
describe DupesController do
describe "GET /new" do
it "should redirect to root_path if user is not logged in" do
get :new
request.should redirect_to root_url
end
it "should display the form if user is logged in" do
session[:user_id] = FactoryGirl.create(:user).id
get :new
request.should render_template 'dupes/new'
end
end
describe "GET /:id" do
it "should redirect to root_path if it can't find the dupe" do
get :show, id: -1
request.should redirect_to root_url
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment