Sha256: 947559a7fda14b0de0ea101b09eb91af453ad5191cee6d99702e71979a95fd4c
Contents?: true
Size: 941 Bytes
Versions: 1
Compression:
Stored size: 941 Bytes
Contents
require 'active_record/spec_helper' require_all File.dirname(__FILE__) + "/../../shared/" def preconfigure CanTango.configure do |config| config.permits.set :on config.permissions.set :off end end describe 'Licenses usage' do context 'Musicianslicense applied to UserRolePermit' do before(:each) { preconfigure @user = User.create!(:email => "kris@gmail.com", :role => 'user') } let(:current_user) { @user } let(:ability) { current_ability(:user) } it "should be allowed to read Song" do ability.should be_allowed_to(:read, Song) end it "should be allowed to write Tune" do ability.should be_allowed_to(:write, Tune) end it "should be allowed to manage Concerto" do ability.should be_allowed_to(:read, Concerto) end it "should be allowed to write Tune" do ability.should_not be_allowed_to(:manage, Improvisation) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cantango-0.8.0 | spec/active_record/scenarios/engines/permit_engine/licenses_spec.rb |