- [:read, :read_one, :update, :update_one, :delete_one].each do |act|
+ [:index, :show, :update_all, :update, :destroy].each do |act|
assert capability.cannot? act, UserPreference
end
# A user with empty tokens
capability = ApiCapability.new tokens
assert capability.cannot? act, UserPreference
end
# A user with empty tokens
capability = ApiCapability.new tokens
- [:read, :read_one, :update, :update_one, :delete_one].each do |act|
+ [:index, :show, :update_all, :update, :destroy].each do |act|
assert capability.cannot? act, UserPreference
end
capability = ApiCapability.new tokens(:allow_read_prefs)
assert capability.cannot? act, UserPreference
end
capability = ApiCapability.new tokens(:allow_read_prefs)
assert capability.can? act, UserPreference
end
capability = ApiCapability.new tokens(:allow_write_prefs)
assert capability.can? act, UserPreference
end
capability = ApiCapability.new tokens(:allow_write_prefs)