asciinema.org/spec/policies/user_policy_spec.rb
2014-08-30 20:10:49 +02:00

19 lines
373 B
Ruby

require 'rails_helper'
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