Group related specs together
This commit is contained in:
@@ -20,9 +20,16 @@ feature 'Legislation Proposals' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Each user has a different and consistent random proposals order', :js do
|
feature "Random pagination" do
|
||||||
create_list(:legislation_proposal, 10, process: process)
|
before do
|
||||||
|
create_list(
|
||||||
|
:legislation_proposal,
|
||||||
|
(Legislation::Proposal.default_per_page + 2),
|
||||||
|
process: process
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'Each user has a different and consistent random proposals order', :js do
|
||||||
in_browser(:one) do
|
in_browser(:one) do
|
||||||
login_as user
|
login_as user
|
||||||
visit legislation_process_proposals_path(process)
|
visit legislation_process_proposals_path(process)
|
||||||
@@ -49,8 +56,6 @@ feature 'Legislation Proposals' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Random order maintained with pagination', :js do
|
scenario 'Random order maintained with pagination', :js do
|
||||||
create_list(:legislation_proposal, (Kaminari.config.default_per_page + 2), process: process)
|
|
||||||
|
|
||||||
login_as user
|
login_as user
|
||||||
visit legislation_process_proposals_path(process)
|
visit legislation_process_proposals_path(process)
|
||||||
first_page_proposals_order = legislation_proposals_order
|
first_page_proposals_order = legislation_proposals_order
|
||||||
@@ -65,17 +70,12 @@ feature 'Legislation Proposals' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Does not crash when the seed is not a number' do
|
scenario 'Does not crash when the seed is not a number' do
|
||||||
create_list(
|
|
||||||
:legislation_proposal,
|
|
||||||
(Legislation::Proposal.default_per_page + 2),
|
|
||||||
process: process
|
|
||||||
)
|
|
||||||
|
|
||||||
login_as user
|
login_as user
|
||||||
visit legislation_process_proposals_path(process, random_seed: "Spoof")
|
visit legislation_process_proposals_path(process, random_seed: "Spoof")
|
||||||
|
|
||||||
expect(page).to have_content "You're on page 1"
|
expect(page).to have_content "You're on page 1"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'Selected filter' do
|
context 'Selected filter' do
|
||||||
scenario 'apperars even if there are not any selected poposals' do
|
scenario 'apperars even if there are not any selected poposals' do
|
||||||
|
|||||||
Reference in New Issue
Block a user