Sha256: 5389630a19490af2b639eee950f003cc8560639e3e54862954f0a7a5603759e2
Contents?: true
Size: 810 Bytes
Versions: 1
Compression:
Stored size: 810 Bytes
Contents
shared_examples_for 'CanTango::Api::Ability::Dsl::Relationship' do describe 'owner_of(model)' do describe 'can' do before do subject.owner_of(Project).can(:edit) end specify { subject.can?(:edit, Project).should be_true } end describe 'cannot' do before do subject.owner_of(Project).can(:edit) end specify { subject.can?(:edit, Project).should be_true } end describe 'block' do before do subject.owner_of(Project) do |owner| owner.can(:edit) owner.cannot(:publish) end end specify { subject.can?(:edit, Project).should be_true } specify { subject.can?(:publish, Project).should be_false } specify { subject.cannot?(:publish, Project).should be_true } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cantango-api-0.1.3 | spec/cantango/api/ability/dsl/relationship_ex.rb |