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

added spec to verify functionality

Dieser Commit ist enthalten in:
Faizaan Gagan 2021-08-12 17:11:58 +05:30
Ursprung dee3691cd0
Commit 89f733ae32

Datei anzeigen

@ -76,4 +76,14 @@ describe CustomWizard::WizardController do
put '/w/super-mega-fun-wizard/skip.json' put '/w/super-mega-fun-wizard/skip.json'
expect(response.parsed_body['redirect_to']).to eq('/t/2') expect(response.parsed_body['redirect_to']).to eq('/t/2')
end end
it "deletes the submission if user has filled up some data" do
@wizard = CustomWizard::Wizard.create(@template["id"], user)
CustomWizard::Submission.new(@wizard, step_1_field_1: "Hello World").save
current_submission = @wizard.current_submission
put '/w/super-mega-fun-wizard/skip.json'
list = CustomWizard::Submission.list(@wizard)
expect(list.any? { |submission| submission.id == current_submission.id }).to eq(false)
end
end end