0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00

IMPROVE: separate out new tests

Dieser Commit ist enthalten in:
merefield 2023-03-10 14:42:42 +00:00
Ursprung 148e188490
Commit b73437299c

Datei anzeigen

@ -131,9 +131,6 @@ describe CustomWizard::Wizard do
expect( expect(
CustomWizard::Wizard.new(@permitted_template, trusted_user).permitted? CustomWizard::Wizard.new(@permitted_template, trusted_user).permitted?
).to eq(true) ).to eq(true)
expect(
CustomWizard::Wizard.new(@guests_permitted_template, trusted_user).permitted?
).to eq(true)
end end
it "permits everyone if everyone is permitted" do it "permits everyone if everyone is permitted" do
@ -206,6 +203,30 @@ describe CustomWizard::Wizard do
end end
end end
context "with subscription and guest wizard" do
before do
enable_subscription("standard")
end
it "permits admins" do
expect(
CustomWizard::Wizard.new(@guests_permitted_template, admin_user).permitted?
).to eq(true)
end
it "permits regular users" do
expect(
CustomWizard::Wizard.new(@guests_permitted_template, user).permitted?
).to eq(true)
end
it "permits guests" do
expect(
CustomWizard::Wizard.new(@guests_permitted_template, nil, "guest123").permitted?
).to eq(true)
end
end
context "submissions" do context "submissions" do
before do before do
CustomWizard::Submission.new(@wizard, step_1_field_1: "I am a user submission").save CustomWizard::Submission.new(@wizard, step_1_field_1: "I am a user submission").save