Increase admin legislative process feature spec to also check detail and list views

This commit is contained in:
Bertocq
2017-06-02 19:17:49 +02:00
parent ae27eba2b5
commit a33341ec52

View File

@@ -39,6 +39,7 @@ feature 'Admin legislation processes' do
click_link "New process" click_link "New process"
fill_in 'legislation_process_title', with: 'An example legislation process' fill_in 'legislation_process_title', with: 'An example legislation process'
fill_in 'legislation_process_summary', with: 'Summary of the process'
fill_in 'legislation_process_description', with: 'Describing the process' fill_in 'legislation_process_description', with: 'Describing the process'
fill_in 'legislation_process_target', with: 'This thing affects people' fill_in 'legislation_process_target', with: 'This thing affects people'
fill_in 'legislation_process_how_to_participate', with: 'You can partipate in this thing by doing...' fill_in 'legislation_process_how_to_participate', with: 'You can partipate in this thing by doing...'
@@ -57,12 +58,30 @@ feature 'Admin legislation processes' do
click_button 'Create process' click_button 'Create process'
expect(page).to have_content 'An example legislation process' expect(page).to have_content 'An example legislation process'
expect(page).to have_content 'Process created successfully'
click_link 'Click to visit'
expect(page).to have_content 'An example legislation process'
expect(page).not_to have_content 'Summary of the process'
expect(page).to have_content 'Describing the process'
expect(page).to have_content 'This thing affects people'
visit legislation_processes_path
expect(page).to have_content 'An example legislation process'
expect(page).to have_content 'Summary of the process'
expect(page).not_to have_content 'Describing the process'
expect(page).not_to have_content 'This thing affects people'
end end
end end
context 'Update' do context 'Update' do
scenario 'Deactivate debate phase', :js do scenario 'Deactivate debate phase', js: true do
process = create(:legislation_process, title: 'An example legislation process') process = create(:legislation_process,
title: 'An example legislation process',
summary: 'Summarizing the process',
description: 'Description of the process')
visit admin_root_path visit admin_root_path
within('#side_menu') do within('#side_menu') do
@@ -75,11 +94,16 @@ feature 'Admin legislation processes' do
expect(find("#debate_phase_active")).to be_checked expect(find("#debate_phase_active")).to be_checked
uncheck "debate_phase_active" uncheck "debate_phase_active"
fill_in 'legislation_process_summary', with: ''
click_button "Save changes" click_button "Save changes"
expect(page).to have_content "Process updated successfully" expect(page).to have_content "Process updated successfully"
expect(find("#debate_start_date").value).to be_blank expect(find("#debate_start_date").value).to be_blank
expect(find("#debate_end_date").value).to be_blank expect(find("#debate_end_date").value).to be_blank
visit legislation_processes_path
expect(page).not_to have_content 'Summarizing the process'
expect(page).to have_content 'Description of the process'
end end
end end
end end