Skip to content

Commit 9456c1e

Browse files
committed
fix test
1 parent de6b07a commit 9456c1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/policies/request_for_comment_policy_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,15 @@
313313

314314
it 'allows anyone to report RfCs' do
315315
%i[admin external_user teacher].each do |factory_name|
316-
expect(policy).to permit(create(factory_name), Comment.new)
316+
expect(policy).to permit(create(factory_name), create(:rfc))
317317
end
318318
end
319319

320320
it 'dose not allow reports when the RfC is not accessable' do
321-
allow(policy).to receive(:show?).and_return(false) # rubocop:disable RSpec/SubjectStub
321+
allow_any_instance_of(policy).to receive(:show?).and_return(false)
322322

323323
%i[admin external_user teacher].each do |factory_name|
324-
expect(policy).not_to permit(create(factory_name), Comment.new)
324+
expect(policy).not_to permit(create(factory_name), RequestForComment.new)
325325
end
326326
end
327327

@@ -334,7 +334,7 @@
334334
end
335335

336336
it 'dose not allow reports of your own content' do
337-
expect(policy).not_to permit(user, Comment.new(user: user))
337+
expect(policy).not_to permit(user, RequestForComment.new(user: user))
338338
end
339339
end
340340
end

0 commit comments

Comments
 (0)