Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
Add test for skip when cant access
Dieser Commit ist enthalten in:
Ursprung
9452907f0a
Commit
33df6f9fbc
1 geänderte Dateien mit 16 neuen und 0 gelöschten Zeilen
|
@ -11,6 +11,14 @@ describe CustomWizard::WizardController do
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let(:permitted_json) {
|
||||||
|
JSON.parse(
|
||||||
|
File.open(
|
||||||
|
"#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/wizard/permitted.json"
|
||||||
|
).read
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
before do
|
before do
|
||||||
CustomWizard::Template.save(
|
CustomWizard::Template.save(
|
||||||
JSON.parse(File.open(
|
JSON.parse(File.open(
|
||||||
|
@ -47,6 +55,14 @@ describe CustomWizard::WizardController do
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'lets user skip if user cant access wizard' do
|
||||||
|
@template["permitted"] = permitted_json["permitted"]
|
||||||
|
CustomWizard::Template.save(@template, skip_jobs: true)
|
||||||
|
|
||||||
|
put '/w/super-mega-fun-wizard/skip.json'
|
||||||
|
expect(response.status).to eq(200)
|
||||||
|
end
|
||||||
|
|
||||||
it 'returns a no skip message if user is not allowed to skip' do
|
it 'returns a no skip message if user is not allowed to skip' do
|
||||||
@template['required'] = 'true'
|
@template['required'] = 'true'
|
||||||
CustomWizard::Template.save(@template)
|
CustomWizard::Template.save(@template)
|
||||||
|
|
Laden …
In neuem Issue referenzieren