Skip to content

Instantly share code, notes, and snippets.

@wndxlori
Created January 28, 2011 16:44
Show Gist options
  • Save wndxlori/800525 to your computer and use it in GitHub Desktop.
Save wndxlori/800525 to your computer and use it in GitHub Desktop.
Shared example group to stub out acl9 authorizations
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