Created
April 26, 2011 19:41
-
-
Save ovenbits/942960 to your computer and use it in GitHub Desktop.
This file contains 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 Manage::UsersController do | |
before(:each) do | |
@current_user = Factory(:user, :roles_mask => 1) #set as admin | |
sign_in @current_user | |
end | |
context 'GET index' do | |
it 'should get :index' do | |
get :index | |
response.should be_success | |
response.should render_template :index | |
end | |
it 'assigns all users' do | |
u = mock_model(User) | |
User.stub_chain(:order,:paginate).and_return([u]) | |
get :index | |
assigns[:users].should eq([u]) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment