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:
Ursprung
148e188490
Commit
b73437299c
1 geänderte Dateien mit 24 neuen und 3 gelöschten Zeilen
|
@ -131,9 +131,6 @@ describe CustomWizard::Wizard do
|
|||
expect(
|
||||
CustomWizard::Wizard.new(@permitted_template, trusted_user).permitted?
|
||||
).to eq(true)
|
||||
expect(
|
||||
CustomWizard::Wizard.new(@guests_permitted_template, trusted_user).permitted?
|
||||
).to eq(true)
|
||||
end
|
||||
|
||||
it "permits everyone if everyone is permitted" do
|
||||
|
@ -206,6 +203,30 @@ describe CustomWizard::Wizard do
|
|||
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
|
||||
before do
|
||||
CustomWizard::Submission.new(@wizard, step_1_field_1: "I am a user submission").save
|
||||
|
|
Laden …
In neuem Issue referenzieren