Introduce Program to include cfp/rooms/tracks/events/event_types/difficulty_levels

This commit is contained in:
Stella Rouzi 2015-10-25 13:29:02 +02:00 committed by Henne Vogelsang
parent 028b82fda8
commit 444356fbc7
117 changed files with 1812 additions and 905 deletions

View file

@ -8,13 +8,13 @@ feature Conference do
shared_examples 'add and update cfp' do
scenario 'adds a new cfp', feature: true, js: true do
expected_count = CallForPaper.count + 1
expected_count = Cfp.count + 1
sign_in organizer
visit new_admin_conference_call_for_paper_path(conference.short_title)
visit new_admin_conference_program_cfp_path(conference.short_title)
click_button 'Create Call for paper'
click_button 'Create Cfp'
expect(flash).
to eq('Creating the call for papers failed. ' +
@ -26,32 +26,29 @@ feature Conference do
page.execute_script(
"$('#conference-end-datepicker').val('#{(today + 6).strftime('%d/%m/%Y')}')")
fill_in 'call_for_paper_rating', with: '4'
click_button 'Create Call for paper'
click_button 'Create Cfp'
# Validations
expect(flash).
to eq('Call for papers successfully created.')
expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y'))
expect(find('#end_date').text).to eq((today + 6).strftime('%A, %B %-d. %Y'))
expect(find('#rating').text).to eq('4')
expect(CallForPaper.count).to eq(expected_count)
expect(Cfp.count).to eq(expected_count)
end
scenario 'update cfp', feature: true, js: true do
conference.call_for_paper = create(:call_for_paper)
expected_count = CallForPaper.count
conference.program.cfp = create(:cfp)
expected_count = Cfp.count
sign_in organizer
visit admin_conference_call_for_paper_path(conference.short_title)
visit admin_conference_program_cfp_path(conference.short_title)
click_link 'Edit'
# Validate update with empty start date will not saved
page.execute_script(
"$('#conference-start-datepicker').val('')")
click_button 'Update Call for paper'
click_button 'Update Cfp'
expect(flash).
to eq('Updating call for papers failed. ' +
"Start date can't be blank.")
@ -63,16 +60,14 @@ feature Conference do
page.execute_script(
"$('#conference-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')")
fill_in 'call_for_paper_rating', with: '0'
click_button 'Update Call for paper'
click_button 'Update Cfp'
# Validations
expect(flash).
to eq('Call for papers successfully updated.')
expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y'))
expect(find('#end_date').text).to eq((today + 14).strftime('%A, %B %-d. %Y'))
expect(find('#rating').text).to eq('0')
expect(CallForPaper.count).to eq(expected_count)
expect(Cfp.count).to eq(expected_count)
end
end