Sha256: 995ebefc1d3b8b17ee7ac3ede8f2b827c1e5fbe42162481a818d48b5eee969d7

Contents?: true

Size: 821 Bytes

Versions: 22

Compression:

Stored size: 821 Bytes

Contents

require 'spec_helper'
shared_examples_for "Having permissions" do
  it 'should contain bloggers permission allowing to read Comments' do
    store.role_groups_permissions['bloggers'].static_rules.can.read.should include('Article')
  end
 
  it 'should contain editors permission allowing to write Posts' do
    store.role_groups_permissions['editors'].static_rules.cannot.write.should include('Post')
  end
end

shared_examples_for "Having compiled permissions" do
  it 'should contain bloggers permission allowing to read Comments' do
    store.role_groups_rules.bloggers.can.should == %|can(:read, Article)\ncan(:read, Comment)|
  end
 
  it 'should contain editors permission allowing to write Posts' do
    store.role_groups_rules.editors.cannot.should == %|cannot(:write, Article)\ncannot(:write, Post)|
  end
end


Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/cantango/permission_engine/shared_examples.rb
cantango-0.9.4.6 spec/cantango/permission_engine/shared_examples.rb
cantango-0.9.4.5 spec/cantango/permission_engine/shared_examples.rb
cantango-0.9.4.3 spec/cantango/permission_engine/shared_examples.rb
cantango-0.9.4.2 spec/cantango/permission_engine/shared_examples.rb
cantango-0.9.4.1 spec/cantango/permission_engine/shared_examples.rb
cantango-0.9.4 spec/cantango/permission_engine/shared_examples.rb
cantango-0.9.3.2 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.9.5 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.9.4 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.9.3 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.9.2 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.9.1 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.9 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.8.1 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.8 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.7 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.6.2 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.6.1 spec/cantango/permission_engine/shared_examples.rb
cantango-0.8.6 spec/cantango/permission_engine/shared_examples.rb