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:
parent
055509ea3a
commit
0a8ccb1e99
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue