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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user