Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (22 sloc) 0.676 kb
require 'spec_helper'
require 'allowy/rspec'
module Allowy
describe ControllerAuthorizationMacros do
include ControllerAuthorizationMacros
before { @controller = stub("FakeController") }
ignore_authorization!
it "aliases allowy as the current_allowy of the controller" do
allowy.should === @controller.current_allowy
end
describe "authorize_for matcher" do
it "works when authorised" do
should_authorize_for(:create, 123)
allowy.authorize!(:create, 123)
end
it "works when not authorised" do
should_not_authorize_for(:create, 123)
allowy.authorize!(:edit, 123)
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.