Legislation Question page
This commit is contained in:
36
spec/features/legislation/debate_spec.rb
Normal file
36
spec/features/legislation/debate_spec.rb
Normal file
@@ -0,0 +1,36 @@
|
||||
require 'rails_helper'
|
||||
|
||||
feature 'Legislation' do
|
||||
|
||||
context 'process debate page' do
|
||||
scenario 'shows question list' do
|
||||
process = create(:legislation_process, debate_start_date: Date.current - 1.day, debate_end_date: Date.current + 2.days)
|
||||
create(:legislation_question, process: process, title: "Question 1")
|
||||
create(:legislation_question, process: process, title: "Question 2")
|
||||
create(:legislation_question, process: process, title: "Question 3")
|
||||
|
||||
visit legislation_process_path(process)
|
||||
|
||||
expect(page).to have_content("Participate in the debate")
|
||||
|
||||
expect(page).to have_content("Question 1")
|
||||
expect(page).to have_content("Question 2")
|
||||
expect(page).to have_content("Question 3")
|
||||
|
||||
click_link "Question 1"
|
||||
|
||||
expect(page).to have_content("Question 1")
|
||||
expect(page).to have_content("Next question")
|
||||
|
||||
click_link "Next question"
|
||||
|
||||
expect(page).to have_content("Question 2")
|
||||
expect(page).to have_content("Next question")
|
||||
|
||||
click_link "Next question"
|
||||
|
||||
expect(page).to have_content("Question 3")
|
||||
expect(page).to_not have_content("Next question")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2,7 +2,7 @@ require 'rails_helper'
|
||||
|
||||
feature 'Legislation' do
|
||||
|
||||
context 'processes#index' do
|
||||
context 'processes home page' do
|
||||
|
||||
scenario 'Processes can be listed' do
|
||||
processes = create_list(:legislation_process, 3)
|
||||
|
||||
Reference in New Issue
Block a user