Sha256: cdc6ea42c86a17dc4f76efbc33b19e1e13176cb2034af4c21b11aafc241200a4
Contents?: true
Size: 962 Bytes
Versions: 21
Compression:
Stored size: 962 Bytes
Contents
require 'rspec' require 'cantango' require 'fixtures/models/items' describe CanTango::PermissionEngine::Permission do before(:all) do @permission = CanTango::PermissionEngine::Permission.new :bloggers end subject do reads = ['Article' , 'Comment'] writes = ['Article' , 'Post'] @permission.static_rules.can = {:read => reads} @permission.static_rules.cannot = {:write => writes} @permission end its(:name) { should == :bloggers } context 'static rules' do subject { @permission.static_rules} it { should include('can') } its(:can) { should include('read')} its(:cannot) { should include('write')} end context 'compiled rules' do subject { @permission.compiled_rules} it { should include('can')} it { should include('cannot')} its(:can) { should == %|can(:read, Article)\ncan(:read, Comment)|} its(:cannot) { should == %|cannot(:write, Article)\ncannot(:write, Post)|} end end
Version data entries
21 entries across 21 versions & 1 rubygems