Merge pull request #1029 from rishabhs95/cfp-datepicker-edit
allow correct input dates according to its constraints while creating Call for Papers
This commit is contained in:
commit
a9569f15d2
2 changed files with 9 additions and 9 deletions
|
|
@ -4,8 +4,8 @@
|
||||||
%h1 Call for Papers
|
%h1 Call for Papers
|
||||||
.row
|
.row
|
||||||
.col-md-8
|
.col-md-8
|
||||||
= semantic_form_for(@cfp, :url => admin_conference_program_cfp_path(@conference.short_title),:html => {:multipart => true}) do |f|
|
= semantic_form_for(@cfp, url: admin_conference_program_cfp_path(@conference.short_title),html: {multipart: true}) do |f|
|
||||||
= f.input :start_date, :as => :string, :input_html => { :id => "conference-start-datepicker", :readonly => "readonly" }
|
= f.input :start_date, as: :string, input_html: { id: "registration-period-start-datepicker", start_date: @conference.start_date, end_date: @conference.end_date, readonly: "readonly" }
|
||||||
= f.input :end_date, :as => :string, :input_html => { :id => "conference-end-datepicker", :readonly => "readonly" }
|
= f.input :end_date, as: :string, input_html: { id: "registration-period-end-datepicker", readonly: "readonly" }
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"}
|
= f.action :submit, as: :button, button_html: { class: "btn btn-primary" }
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,9 @@ feature Conference do
|
||||||
|
|
||||||
today = Date.today - 1
|
today = Date.today - 1
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
"$('#registration-period-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-end-datepicker').val('#{(today + 6).strftime('%d/%m/%Y')}')")
|
"$('#registration-period-end-datepicker').val('#{(today + 6).strftime('%d/%m/%Y')}')")
|
||||||
|
|
||||||
click_button 'Create Cfp'
|
click_button 'Create Cfp'
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ feature Conference do
|
||||||
|
|
||||||
# Validate update with empty start date will not saved
|
# Validate update with empty start date will not saved
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-start-datepicker').val('')")
|
"$('#registration-period-start-datepicker').val('')")
|
||||||
click_button 'Update Cfp'
|
click_button 'Update Cfp'
|
||||||
expect(flash).
|
expect(flash).
|
||||||
to eq('Updating call for papers failed. ' +
|
to eq('Updating call for papers failed. ' +
|
||||||
|
|
@ -56,9 +56,9 @@ feature Conference do
|
||||||
# Fill in date
|
# Fill in date
|
||||||
today = Date.today - 9
|
today = Date.today - 9
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
"$('#registration-period-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
|
||||||
page.execute_script(
|
page.execute_script(
|
||||||
"$('#conference-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')")
|
"$('#registration-period-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')")
|
||||||
|
|
||||||
click_button 'Update Cfp'
|
click_button 'Update Cfp'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue