spec/cantango/api/user/can_api_spec.rb in cantango-0.9.4.1 vs spec/cantango/api/user/can_api_spec.rb in cantango-0.9.4.2
- old
+ new
@@ -6,19 +6,19 @@
# require 'cantango/configuration/engines/store_engine_shared'
class User
include CanTango::Users::Masquerade
include_and_extend SimpleRoles
+
+ tango_user
end
class Admin < User
+ tango_user
end
CanTango.configure do |config|
- config.users.register :user, User
- config.users.register :admin, Admin
-
config.cache_engine.set :off
config.permit_engine.set :on
end
# puts "#{CanTango.config.users.registered_classes} : #{CanTango.config.users.registered}"
@@ -57,22 +57,22 @@
describe 'user_ability' do
specify { subject.user_ability(subject.current_user).should be_a CanTango::Ability }
specify { subject.user_ability(subject.current_admin).should be_a CanTango::Ability }
end
- describe 'current_ability :user' do
- specify { subject.current_ability(:user).should be_a CanTango::Ability }
+ describe 'current_user_ability :user' do
+ specify { subject.current_user_ability(:user).should be_a CanTango::Ability }
it 'should set the :user user correctly on ability' do
- subject.current_ability(:user).user.should == subject.current_user
+ subject.current_user_ability(:user).user.should == subject.current_user
end
end
- describe 'current_ability :admin' do
- specify { subject.current_ability(:admin).should be_a CanTango::Ability }
+ describe 'current_user_ability :admin' do
+ specify { subject.current_user_ability(:admin).should be_a CanTango::Ability }
it 'should set the :admin user correctly on ability' do
- subject.current_ability(:admin).user.should == subject.current_admin
+ subject.current_user_ability(:admin).user.should == subject.current_admin
end
end
describe 'user' do
specify { subject.current_user.role.should == 'user' }