mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 06:57:43 +08:00
@ -3,7 +3,7 @@
|
||||
describe "Topic" do
|
||||
let!(:raw) { "this is me testing a new topic by automation" }
|
||||
let!(:title) { "This is a new topic created by automation" }
|
||||
fab!(:category) { Fabricate(:category) }
|
||||
fab!(:category)
|
||||
fab!(:tag1) { Fabricate(:tag) }
|
||||
fab!(:tag2) { Fabricate(:tag) }
|
||||
|
||||
|
@ -9,14 +9,14 @@ RSpec.describe DiscourseAutomation::Destroy do
|
||||
subject(:result) { described_class.call(params:, **dependencies) }
|
||||
|
||||
fab!(:user) { Fabricate(:admin) }
|
||||
fab!(:automation) { Fabricate(:automation) }
|
||||
fab!(:automation)
|
||||
|
||||
let(:guardian) { user.guardian }
|
||||
let(:params) { { automation_id: automation.id } }
|
||||
let(:dependencies) { { guardian: } }
|
||||
|
||||
context "when user can't destroy the automation" do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:user)
|
||||
|
||||
it { is_expected.to fail_a_policy(:can_destroy_automation) }
|
||||
end
|
||||
|
Reference in New Issue
Block a user