Simplify random seed conversion to float

The method `to_f` already returns `0.0` instead of raising an exception
when handling non-numeric values.
This commit is contained in:
Javi Martín
2018-10-01 20:44:08 +02:00
parent ba7ca11cd8
commit 6f62d76c71
2 changed files with 14 additions and 6 deletions

View File

@@ -64,6 +64,19 @@ feature 'Legislation Proposals' do
expect(legislation_proposals_order).to eq(first_page_proposals_order)
end
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
visit legislation_process_proposals_path(process, random_seed: "Spoof")
expect(page).to have_content "You're on page 1"
end
context 'Selected filter' do
scenario 'apperars even if there are not any selected poposals' do
create(:legislation_proposal, legislation_process_id: process.id)