Legislation Question page

This commit is contained in:
Amaia Castro
2016-12-22 12:59:58 +01:00
parent 96d000ae62
commit 368430d914
7 changed files with 106 additions and 2 deletions

View 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

View File

@@ -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)