From 2dc3950cb09ea88f273466ca24f6baebb500ea0d Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Tue, 23 Feb 2021 18:43:18 -0800 Subject: [PATCH] Fix commericals feature specs (UI consistency). --- app/views/admin/commercials/index.html.haml | 2 +- app/views/proposals/_form.html.haml | 2 +- spec/features/commercials_spec.rb | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/admin/commercials/index.html.haml b/app/views/admin/commercials/index.html.haml index 2dbe10a2..2570fb52 100644 --- a/app/views/admin/commercials/index.html.haml +++ b/app/views/admin/commercials/index.html.haml @@ -16,7 +16,7 @@ = semantic_form_for(@commercial, url: admin_conference_commercials_path(conference_id: @conference.short_title)) do |f| = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', autofocus: true }, hint: 'Just paste the url of your video/photo provider. YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }, label: "Save Materials" %hr - @commercials.each_slice(3) do |slice| diff --git a/app/views/proposals/_form.html.haml b/app/views/proposals/_form.html.haml index 7f6716d5..312e5b1c 100644 --- a/app/views/proposals/_form.html.haml +++ b/app/views/proposals/_form.html.haml @@ -22,7 +22,7 @@ = semantic_form_for(@event.commercials.build, url: conference_program_proposal_commercials_path(conference_id: @conference.short_title, proposal_id: @event)) do |f| = f.input :url, label: 'URL', as: :string, input_html: { required: 'required', type: 'url' }, hint: 'Just paste the url of your video/photo provider. Currently supported: YouTube, Vimeo, SpeakerDeck, SlideShare, Instagram, Flickr.' - = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true } + = f.action :submit, as: :button, button_html: { class: 'btn btn-primary pull-right', disabled: true }, label: "Save Materials" %hr - @event.commercials.each_slice(3) do |slice| .row diff --git a/spec/features/commercials_spec.rb b/spec/features/commercials_spec.rb index 814c49d0..eefcd4cc 100644 --- a/spec/features/commercials_spec.rb +++ b/spec/features/commercials_spec.rb @@ -39,7 +39,7 @@ feature Commercial do click_link 'Delete' end page.find('#flash') - expect(flash).to eq('Materials were successfully destroyed.') + expect(flash).to eq('Materials were successfully removed.') expect(conference.commercials.count).to eq(0) end end @@ -68,6 +68,8 @@ feature Commercial do end scenario 'does not add an invalid commercial of an event', feature: true, js: true do + # TODO (snapcon) + pending("Snap!Con allows all materials to be saved.") visit edit_conference_program_proposal_path(conference.short_title, event.id) click_link 'Materials' fill_in 'commercial_url', with: 'invalid_commercial_url' @@ -116,7 +118,7 @@ feature Commercial do click_link 'Delete' end page.find('#flash') - expect(flash).to eq('Materials successfully destroyed.') + expect(flash).to eq('Materials were successfully destroyed.') expect(event.commercials.count).to eq(0) end end