Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-26 02:50:28 +01:00
Fix specs
Dieser Commit ist enthalten in:
Ursprung
e7ee89048a
Commit
e5d6a20532
4 geänderte Dateien mit 8 neuen und 7 gelöschten Zeilen
|
@ -8,6 +8,7 @@ describe CustomWizard::TemplateValidator do
|
||||||
let(:permitted_json) { get_wizard_fixture("wizard/permitted") }
|
let(:permitted_json) { get_wizard_fixture("wizard/permitted") }
|
||||||
let(:composer_preview) { get_wizard_fixture("field/composer_preview") }
|
let(:composer_preview) { get_wizard_fixture("field/composer_preview") }
|
||||||
let(:guests_permitted) { get_wizard_fixture("wizard/guests_permitted") }
|
let(:guests_permitted) { get_wizard_fixture("wizard/guests_permitted") }
|
||||||
|
let(:upload_field) { get_wizard_fixture("field/upload") }
|
||||||
|
|
||||||
let(:valid_liquid_template) {
|
let(:valid_liquid_template) {
|
||||||
<<-LIQUID.strip
|
<<-LIQUID.strip
|
||||||
|
@ -149,6 +150,7 @@ describe CustomWizard::TemplateValidator do
|
||||||
|
|
||||||
it "validates user-only features" do
|
it "validates user-only features" do
|
||||||
template[:permitted] = guests_permitted['permitted']
|
template[:permitted] = guests_permitted['permitted']
|
||||||
|
template[:steps][0][:fields] << upload_field
|
||||||
validator = CustomWizard::TemplateValidator.new(template)
|
validator = CustomWizard::TemplateValidator.new(template)
|
||||||
expect(validator.perform).to eq(false)
|
expect(validator.perform).to eq(false)
|
||||||
errors = validator.errors.to_a
|
errors = validator.errors.to_a
|
||||||
|
|
6
spec/fixtures/field/upload.json
gevendort
Normale Datei
6
spec/fixtures/field/upload.json
gevendort
Normale Datei
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"id": "step_2_field_7",
|
||||||
|
"label": "Upload",
|
||||||
|
"type": "upload",
|
||||||
|
"file_types": ".jpg,.jpeg,.png"
|
||||||
|
}
|
6
spec/fixtures/wizard.json
gevendort
6
spec/fixtures/wizard.json
gevendort
|
@ -74,12 +74,6 @@
|
||||||
"id": "step_2_field_5",
|
"id": "step_2_field_5",
|
||||||
"label": "Checkbox",
|
"label": "Checkbox",
|
||||||
"type": "checkbox"
|
"type": "checkbox"
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "step_2_field_7",
|
|
||||||
"label": "Upload",
|
|
||||||
"type": "upload",
|
|
||||||
"file_types": ".jpg,.jpeg,.png"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Because I couldn't think of another name for this step :)"
|
"description": "Because I couldn't think of another name for this step :)"
|
||||||
|
|
|
@ -29,6 +29,5 @@ describe CustomWizard::FieldSerializer do
|
||||||
scope: Guardian.new(user)
|
scope: Guardian.new(user)
|
||||||
).as_json
|
).as_json
|
||||||
expect(json_array[0][:format]).to eq("YYYY-MM-DD")
|
expect(json_array[0][:format]).to eq("YYYY-MM-DD")
|
||||||
expect(json_array[5][:file_types]).to eq(".jpg,.jpeg,.png")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Laden …
In neuem Issue referenzieren