From eb1e8ed23827689000f41d2fcde85decd93e44bf Mon Sep 17 00:00:00 2001 From: gotens1211 Date: Wed, 8 Mar 2017 15:27:38 +0530 Subject: [PATCH] Changed the default state of components in splashpage to selected Mark the splashpage components to checked for the new action, also modified the display changes in splashpages test Fixes #1340 --- app/views/admin/splashpages/_form.html.haml | 18 +++++++++--------- spec/features/versions_spec.rb | 14 ++++++++++---- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/app/views/admin/splashpages/_form.html.haml b/app/views/admin/splashpages/_form.html.haml index 38335b31..f945b2c9 100644 --- a/app/views/admin/splashpages/_form.html.haml +++ b/app/views/admin/splashpages/_form.html.haml @@ -6,15 +6,15 @@ .col-md-8 = semantic_form_for(@splashpage, url: admin_conference_splashpage_path(@conference.short_title)) do |f| = f.inputs name: 'Components' do - = f.input :include_tracks, label: 'Display tracks on the splashpage?' - = f.input :include_program, label: 'Display program on the splashpage?' - = f.input :include_cfp, label: 'Display call for papers information on splashpage, while cfp is open?' - = f.input :include_venue, label: 'Display venue on the splashpage?' - = f.input :include_registrations, label: 'Display the registration period on the splashpage?' - = f.input :include_tickets, label: 'Display tickets on the splashpage?' - = f.input :include_lodgings, label: 'Display the lodgings on the splashpage?' - = f.input :include_sponsors, label: 'Display sponsors on the splashpage?' - = f.input :include_social_media, label: 'Display social media on the splashpage?' + = f.input :include_tracks, label: 'Display tracks', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tracks) } + = f.input :include_program, label: 'Display program', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_program) } + = f.input :include_cfp, label: 'Display call for papers information on splashpage, while cfp is open', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_cfp) } + = f.input :include_venue, label: 'Display venue', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_venue) } + = f.input :include_registrations, label: 'Display the registration period', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_registrations) } + = f.input :include_tickets, label: 'Display tickets', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_tickets) } + = f.input :include_lodgings, label: 'Display the lodgings', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_lodgings) } + = f.input :include_sponsors, label: 'Display sponsors', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_sponsors) } + = f.input :include_social_media, label: 'Display social media', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_social_media) } = f.inputs name: 'Access' do = f.input :public, label: 'Make splash page public?' %p.text-right diff --git a/spec/features/versions_spec.rb b/spec/features/versions_spec.rb index 1d800572..ba43bc27 100644 --- a/spec/features/versions_spec.rb +++ b/spec/features/versions_spec.rb @@ -221,15 +221,21 @@ feature 'Version' do click_button 'Save Splashpage' click_link 'Edit' - check('Make splash page public') - check('Display tracks on the splashpage?') - check('Display the registration period on the splashpage?') + uncheck('Display program') + uncheck('Display call for papers information on splashpage, while cfp is open') + uncheck('Display venue') + uncheck('Display tickets') + uncheck('Display the lodgings') + uncheck('Display sponsors') + uncheck('Display social media') + check('Make splash page public?') click_button 'Save Splashpage' click_link 'Delete' visit admin_revision_history_path expect(page).to have_text("#{organizer.name} created new splashpage in conference #{conference.short_title}") - expect(page).to have_text("#{organizer.name} updated public, include tracks and include registrations of splashpage in conference #{conference.short_title}") + expect(page).to have_text("#{organizer.name} updated public, include program, include cfp, include venue, include tickets, include lodgings, + include sponsors and include social media of splashpage in conference #{conference.short_title}") expect(page).to have_text("#{organizer.name} deleted splashpage in conference #{conference.short_title}") end