Replace open to active filter on admin legislation processes index

Now active filter show open processes and the next ones, processes with a start date greather than current date.
This commit is contained in:
decabeza
2019-02-14 16:11:37 +01:00
parent a9d96f7e23
commit 0d834744fd
5 changed files with 20 additions and 5 deletions

View File

@@ -29,10 +29,24 @@ feature "Admin legislation processes" do
context "Index" do
scenario "Displaying legislation processes" do
process = create(:legislation_process)
process_1 = create(:legislation_process, title: "Process open")
process_2 = create(:legislation_process, title: "Process for the future",
start_date: Date.current + 5.days)
process_3 = create(:legislation_process, title: "Process closed",
start_date: Date.current - 10.days,
end_date: Date.current - 6.days)
visit admin_legislation_processes_path(filter: "active")
expect(page).to have_content(process_1.title)
expect(page).to have_content(process_2.title)
expect(page).not_to have_content(process_3.title)
visit admin_legislation_processes_path(filter: "all")
expect(page).to have_content(process.title)
expect(page).to have_content(process_1.title)
expect(page).to have_content(process_2.title)
expect(page).to have_content(process_3.title)
end
scenario "Processes are sorted by descending start date" do