Skip to content

Instantly share code, notes, and snippets.

@ovenbits
Created April 26, 2011 19:41
Show Gist options
  • Save ovenbits/942960 to your computer and use it in GitHub Desktop.
Save ovenbits/942960 to your computer and use it in GitHub Desktop.
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