Sha256: 02298a3872e208c578ae32c2faade40374c213ffa980dd8f322d5a28de041b5f
Contents?: true
Size: 1010 Bytes
Versions: 4
Compression:
Stored size: 1010 Bytes
Contents
require 'cantango/config' require 'fixtures/models' CanTango.configure do |config| config.users.register :user, User config.users.register :admin, Admin config.accounts.register :user, UserAccount config.accounts.register :admin, AdminAccount end require 'spec_helper' require 'helpers/current_user_accounts' class Context include CanTango::Api::Ability::Account include_and_extend ::CurrentUserAccounts end describe CanTango::Api::Ability::Account do subject { Context.new } describe 'account_ability' do specify { subject.account_ability(subject.current_user_account).should be_a CanTango::Ability::Executor } specify { subject.account_ability(subject.current_admin_account).should be_a CanTango::Ability::Executor } end describe 'current_account_ability' do specify { subject.current_account_ability(:user).should be_a CanTango::Ability::Executor } specify { subject.current_account_ability(:admin).should be_a CanTango::Ability::Executor } end end
Version data entries
4 entries across 4 versions & 1 rubygems