Created
November 29, 2011 22:34
-
-
Save daniel-nelson/1406905 to your computer and use it in GitHub Desktop.
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 '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