Skip to content

Instantly share code, notes, and snippets.

@daniel-nelson
Created November 29, 2011 22:34
Show Gist options
  • Select an option

  • Save daniel-nelson/1406905 to your computer and use it in GitHub Desktop.

Select an option

Save daniel-nelson/1406905 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Admin::UsersController do
describe "GET index" do
context "while not signed-in" do
it "should redirect to the sign-in page" do
get :index
response.should redirect_to(new_admin_session_url)
end
end
context "while signed-in as a user" do
it "should redirect to the sign-in page" do
user = Factory(:user)
sign_in(user)
get :index
response.should redirect_to(new_admin_session_url)
end
end
context "while signed-in as a super admin" do
before(:each) do
@admin = Factory(:admin)
sign_in(@admin)
end
it "should list the users" do
...
end
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment