2014-08-30 17:38:47 +00:00
|
|
|
require 'rails_helper'
|
2014-07-05 12:59:42 +00:00
|
|
|
|
|
|
|
describe UserPolicy do
|
|
|
|
|
|
|
|
subject { described_class }
|
|
|
|
|
|
|
|
permissions :update? do
|
|
|
|
it "grants access if edited user is current user" do
|
|
|
|
user = User.new
|
|
|
|
expect(subject).to permit(user, user)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "denies access if edited user is not current user" do
|
|
|
|
expect(subject).not_to permit(User.new, User.new)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|