Skip to content

Commit 0e35853

Browse files
committed
fix(users_controller_spec): Stub author permissions
The alchemy admin base controller now has a timezone feature, which checks the user to have at least author permissions (`:edit_content`). We need to stub this as well because we stub `can? :update_user` in this spec as well.
1 parent e0a30b0 commit 0e35853

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

spec/controllers/admin/users_controller_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ module Alchemy
176176

177177
context "if user is permitted to update roles" do
178178
before do
179+
allow(controller)
180+
.to receive(:can?)
181+
.with(:edit_content, Alchemy::Page)
182+
.and_return(true)
179183
allow(controller)
180184
.to receive(:can?)
181185
.with(:update_role, Alchemy::User)
@@ -192,6 +196,10 @@ module Alchemy
192196

193197
context "if the user is not permitted to update roles" do
194198
before do
199+
allow(controller)
200+
.to receive(:can?)
201+
.with(:edit_content, Alchemy::Page)
202+
.and_return(true)
195203
allow(controller)
196204
.to receive(:can?)
197205
.with(:update_role, Alchemy::User)

0 commit comments

Comments
 (0)