add homepage for legislation processes

This commit is contained in:
dperez
2018-12-07 12:40:07 +01:00
parent f4c402c3cb
commit bef404c443
13 changed files with 175 additions and 2 deletions

View File

@@ -168,6 +168,32 @@ feature 'Legislation' do
end
end
context 'homepage' do
scenario 'enabled' do
process = create(:legislation_process, homepage_enabled: true,
homepage: 'This is the process homepage',
debate_start_date: Date.current + 1.day,
debate_end_date: Date.current + 2.days)
visit legislation_process_path(process)
expect(page).to have_content("This is the process homepage")
expect(page).to_not have_content("Participate in the debate")
end
scenario 'disabled', :with_frozen_time do
process = create(:legislation_process, homepage_enabled: false,
homepage: 'This is the process homepage',
debate_start_date: Date.current + 1.day,
debate_end_date: Date.current + 2.days)
visit legislation_process_path(process)
expect(page).to have_content("This phase is not open yet")
expect(page).to_not have_content("This is the process homepage")
end
end
context 'debate phase' do
scenario 'not open', :with_frozen_time do
process = create(:legislation_process, debate_start_date: Date.current + 1.day, debate_end_date: Date.current + 2.days)