Created
January 28, 2011 16:44
-
-
Save wndxlori/800525 to your computer and use it in GitHub Desktop.
Shared example group to stub out acl9 authorizations
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
ignore_access_control_helper.rb: | |
shared_examples_for "IgnoreAccessControl" do | |
before(:each) do | |
controller.stub!(:current_user).and_return(mock(:has_role? => true)) | |
end | |
end | |
users_controller_spec.rb: | |
require 'spec_helper' | |
describe UsersController do | |
it_behaves_like 'IgnoreAccessControl' | |
describe "GET /users/new" do | |
it "should be successful" do | |
get :new | |
response.should be_success | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment