Sha256: c058f46141112d0de5d4038430732dbf90c6c05bc472b6cb70cb6d57a7f4eaa4
Contents?: true
Size: 1.56 KB
Versions: 1
Compression:
Stored size: 1.56 KB
Contents
require 'spec_helper' module AdminAccountPermits class AdminRolePermit < CanTango::Permit::Role end end class MusicianRolePermit < CanTango::Permit::Role; end class EditorsRoleGroupPermit < CanTango::Permit::RoleGroup; end class AdminAccountPermit < CanTango::Permit::AccountType; end class AdminPermit < CanTango::Permit::UserType; end describe CanTango::Permit do it "should register RolePermit-based permits" do CanTango.config.permits.admin_account.role[:admin].should == AdminAccountPermits::AdminRolePermit CanTango.config.permits.role[:musician].should == MusicianRolePermit end it "should register RoleGroupPermit-based permits" do CanTango.config.permits.role_group[:editors].should == EditorsRoleGroupPermit end it "should register UserPermit-based permits" do CanTango.config.permits.user[:admin].should == AdminPermit end it "should register AccountPermit-based permits" do CanTango.config.permits.account[:admin].should == AdminAccountPermit end context "registration of double-inherited permits (fx RolePermit ones) - specially for Kris ;)" do before do class GuitaristRolePermit < MusicianRolePermit; end class AdminAccountPermits::AngryAdminRolePermit < AdminAccountPermits::AdminRolePermit; end end it "should register basic namespaced" do CanTango.config.permits.role[:guitarist].should == GuitaristRolePermit end it "should register account-namespaced" do CanTango.config.permits.admin_account.role[:angry_admin].should == AdminAccountPermits::AngryAdminRolePermit end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cantango-permits-0.1.1 | spec/cantango/executor/more_permit_spec.rb |