Add more specs for process page (phases)
This commit is contained in:
@@ -36,23 +36,77 @@ feature 'Legislation' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'processes#show' do
|
context 'process page' do
|
||||||
scenario 'Debate phase not open' do
|
context 'debate phase' do
|
||||||
process = create(:legislation_process, title: "Process open",
|
scenario 'not open' do
|
||||||
debate_start_date: Date.current + 1.day, debate_end_date: Date.current + 2.days)
|
process = create(:legislation_process, debate_start_date: Date.current + 1.day, debate_end_date: Date.current + 2.days)
|
||||||
|
|
||||||
visit legislation_process_path(process)
|
visit legislation_process_path(process)
|
||||||
|
|
||||||
expect(page).to have_content("This phase is not open yet")
|
expect(page).to have_content("This phase is not open yet")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'open' do
|
||||||
|
process = create(:legislation_process, debate_start_date: Date.current - 1.day, debate_end_date: Date.current + 2.days)
|
||||||
|
|
||||||
|
visit legislation_process_path(process)
|
||||||
|
|
||||||
|
expect(page).to have_content("Participate in the debate")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Debate phase open' do
|
context 'draft publication phase' do
|
||||||
process = create(:legislation_process, title: "Process open",
|
scenario 'not open' do
|
||||||
debate_start_date: Date.current - 1.day, debate_end_date: Date.current + 2.days)
|
process = create(:legislation_process, draft_publication_date: Date.current + 1.day)
|
||||||
|
|
||||||
visit legislation_process_path(process)
|
visit legislation_process_draft_publication_path(process)
|
||||||
|
|
||||||
expect(page).to have_content("Participate in the debate")
|
expect(page).to have_content("This phase is not open yet")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'open' do
|
||||||
|
process = create(:legislation_process, draft_publication_date: Date.current)
|
||||||
|
|
||||||
|
visit legislation_process_draft_publication_path(process)
|
||||||
|
|
||||||
|
expect(page).to have_content("There are no drafts published")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'allegations phase' do
|
||||||
|
scenario 'not open' do
|
||||||
|
process = create(:legislation_process, allegations_start_date: Date.current + 1.day, allegations_end_date: Date.current + 2.days)
|
||||||
|
|
||||||
|
visit legislation_process_allegations_path(process)
|
||||||
|
|
||||||
|
expect(page).to have_content("This phase is not open yet")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'open' do
|
||||||
|
process = create(:legislation_process, allegations_start_date: Date.current - 1.day, allegations_end_date: Date.current + 2.days)
|
||||||
|
|
||||||
|
visit legislation_process_allegations_path(process)
|
||||||
|
|
||||||
|
expect(page).to have_content("There are no drafts published")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'final version publication phase' do
|
||||||
|
scenario 'not open' do
|
||||||
|
process = create(:legislation_process, final_publication_date: Date.current + 1.day)
|
||||||
|
|
||||||
|
visit legislation_process_final_version_publication_path(process)
|
||||||
|
|
||||||
|
expect(page).to have_content("This phase is not open yet")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'open' do
|
||||||
|
process = create(:legislation_process, final_publication_date: Date.current)
|
||||||
|
|
||||||
|
visit legislation_process_final_version_publication_path(process)
|
||||||
|
|
||||||
|
expect(page).to have_content("Results have not been published yet")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user