1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

New expectations rspec syntax in README

This commit is contained in:
Kir Shatrov 2013-12-26 18:25:56 +01:00
parent 055509ea3a
commit 0a8ccb1e99

View file

@ -375,15 +375,15 @@ describe PostPolicy do
permissions :create? do
it "denies access if post is published" do
should_not permit(User.new(:admin => false), Post.new(:published => true))
expect(subject).not_to permit(User.new(:admin => false), Post.new(:published => true))
end
it "grants access if post is published and user is an admin" do
should permit(User.new(:admin => true), Post.new(:published => true))
expect(subject).to permit(User.new(:admin => true), Post.new(:published => true))
end
it "grants access if post is unpublished" do
should permit(User.new(:admin => false), Post.new(:published => false))
expect(subject).to permit(User.new(:admin => false), Post.new(:published => false))
end
end
end