Implement consistent admin interface
* Consistent route/model/controller/view layout * Get rid of unused photos, speakers, dietchoices, social_events controllers * Drop unused :public from Rooms and :description from CallForPapers
This commit is contained in:
parent
f6a87331be
commit
28063129c7
133 changed files with 1461 additions and 1461 deletions
|
|
@ -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 = CallForPapers.count + 1
|
||||
expected_count = CallForPaper.count + 1
|
||||
|
||||
sign_in organizer
|
||||
|
||||
visit admin_conference_callforpapers_path(conference.short_title)
|
||||
visit new_admin_conference_call_for_paper_path(conference.short_title)
|
||||
|
||||
click_button 'Create Call for papers'
|
||||
click_button 'Create Call for paper'
|
||||
|
||||
expect(flash).
|
||||
to eq('Creating the call for papers failed. ' +
|
||||
|
|
@ -26,36 +26,32 @@ feature Conference do
|
|||
page.execute_script(
|
||||
"$('#conference-end-datepicker').val('#{(today + 7).strftime('%d/%m/%Y')}')")
|
||||
|
||||
fill_in 'call_for_papers_description', with: 'Cfp description'
|
||||
fill_in 'call_for_papers_rating', with: '4'
|
||||
fill_in 'call_for_paper_rating', with: '4'
|
||||
|
||||
click_button 'Create Call for papers'
|
||||
click_button 'Create Call for paper'
|
||||
|
||||
# Validations
|
||||
expect(flash).
|
||||
to eq('Call for Papers was successfully created.')
|
||||
expect(find('#conference-start-datepicker').value).
|
||||
to eq(today.strftime('%Y-%m-%d'))
|
||||
expect(find('#conference-end-datepicker').value).
|
||||
to eq((today + 7).strftime('%Y-%m-%d'))
|
||||
expect(find('#call_for_papers_description').text).
|
||||
to eq('Cfp description')
|
||||
expect(find('#call_for_papers_rating').value).to eq('4')
|
||||
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 + 7).strftime('%A, %B %-d. %Y'))
|
||||
expect(find('#rating').text).to eq('4')
|
||||
|
||||
expect(CallForPapers.count).to eq(expected_count)
|
||||
expect(CallForPaper.count).to eq(expected_count)
|
||||
end
|
||||
|
||||
scenario 'update cfp', feature: true, js: true do
|
||||
conference.call_for_papers = create(:call_for_papers)
|
||||
expected_count = CallForPapers.count
|
||||
conference.call_for_paper = create(:call_for_paper)
|
||||
expected_count = CallForPaper.count
|
||||
|
||||
sign_in organizer
|
||||
visit admin_conference_callforpapers_path(conference.short_title)
|
||||
visit admin_conference_call_for_paper_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 papers'
|
||||
click_button 'Update Call for paper'
|
||||
expect(flash).
|
||||
to eq('Updating call for papers failed. ' +
|
||||
"Start date can't be blank.")
|
||||
|
|
@ -67,21 +63,16 @@ feature Conference do
|
|||
page.execute_script(
|
||||
"$('#conference-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')")
|
||||
|
||||
fill_in 'call_for_papers_description', with: 'Updated description'
|
||||
fill_in 'call_for_papers_rating', with: '0'
|
||||
click_button 'Update Call for papers'
|
||||
fill_in 'call_for_paper_rating', with: '0'
|
||||
click_button 'Update Call for paper'
|
||||
|
||||
# Validations
|
||||
expect(flash).
|
||||
to eq('Call for Papers was successfully updated.')
|
||||
expect(find('#conference-start-datepicker').value).
|
||||
to eq(today.strftime('%Y-%m-%d'))
|
||||
expect(find('#conference-end-datepicker').value).
|
||||
to eq((today + 14).strftime('%Y-%m-%d'))
|
||||
expect(find('#call_for_papers_description').text).
|
||||
to eq('Updated description')
|
||||
expect(find('#call_for_papers_rating').value).to eq('0')
|
||||
expect(CallForPapers.count).to eq(expected_count)
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue