From 58ae746e78a5b45a11d8adc64b569e93bd0d14ff Mon Sep 17 00:00:00 2001 From: CactusPuppy Date: Sun, 7 Mar 2021 23:00:40 -0800 Subject: [PATCH] Add test for covering Rest to Template button --- spec/features/proposals_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 482282a2..18297d2d 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -191,5 +191,24 @@ feature Event do @event.reload expect(@event.state).to eq('withdrawn') end + + scenario 'can reset to text template', feature: true, js: true do + event_type = conference.program.event_types[-1] + event_type.description = 'Example event description' + event_type.save! + + sign_in participant + visit new_conference_program_proposal_path(conference.short_title) + + fill_in 'event_title', with: 'Example Proposal' + select(event_type.title, from: 'event[event_type_id]') + fill_in 'event_submission_text', with: 'Lorem ipsum example submission text' + + accept_confirm do + click_button 'Reset to Template' + end + + expect(page.find('#event_submission_text').value).to eq(event_type.description) + end end end