Created
October 26, 2012 16:58
-
-
Save pcmantz/3959907 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'cantango/rspec/matchers' | |
describe GuestRolePermit do | |
context 'a guest user' do | |
subject(:guest_user) { FactoryGirl.create(:guest_user) } | |
context 'acting on a public bundle' do | |
let(:public_bundle) { FactoryGirl.create(:public_bundle) } | |
it { should be_allowed_to :read, public_bundle } | |
[:create, :update, :destroy].each do |action| | |
it { should_not be_allowed_to action, public_bundle } | |
end | |
end | |
context 'acting on a non-public bundle' do | |
let(:private_bundle) { FactoryGirl.create(:bundle, public_at: nil) } | |
[:create, :read, :update, :destroy].each do |action| | |
it { should_not be_allowed_to action, private_bundle } | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment