diff --git a/app/views/admin/legislation/proposals/_proposals.html.erb b/app/views/admin/legislation/proposals/_proposals.html.erb index a18d0b623..2f75b4223 100644 --- a/app/views/admin/legislation/proposals/_proposals.html.erb +++ b/app/views/admin/legislation/proposals/_proposals.html.erb @@ -3,7 +3,7 @@ <%= render 'shared/wide_order_selector', i18n_namespace: "admin.legislation.processes.proposals" %> -
| <%= t("admin.legislation.proposals.index.id") %> | @@ -15,7 +15,7 @@||
|---|---|---|
| <%= proposal.id %> | <%= proposal.title %> | <%= proposal.cached_votes_up %> | diff --git a/spec/features/admin/legislation/proposals_spec.rb b/spec/features/admin/legislation/proposals_spec.rb index 5be2bf08b..bd8caf0a3 100644 --- a/spec/features/admin/legislation/proposals_spec.rb +++ b/spec/features/admin/legislation/proposals_spec.rb @@ -42,16 +42,10 @@ feature 'Admin legislation processes' do visit admin_legislation_process_proposals_path(process.id) select "Title", from: "order-selector-participation" - within('#proposals_table') do - within(:xpath, "//tbody/tr[1]") do - expect(page).to have_content('aaaa') - end - within(:xpath, "//tbody/tr[2]") do - expect(page).to have_content('bbbb') - end - within(:xpath, "//tbody/tr[3]") do - expect(page).to have_content('cccc') - end + within('#legislation_proposals_list') do + within all('.legislation_proposal')[0] { expect(page).to have_content('aaaa') } + within all('.legislation_proposal')[1] { expect(page).to have_content('bbbb') } + within all('.legislation_proposal')[2] { expect(page).to have_content('cccc') } end end @@ -64,10 +58,10 @@ feature 'Admin legislation processes' do visit admin_legislation_process_proposals_path(process.id) select "Supports", from: "order-selector-participation" - within('#proposals_table') do - within(:xpath, "//tbody/tr[1]") { expect(page).to have_content('30') } - within(:xpath, "//tbody/tr[2]") { expect(page).to have_content('20') } - within(:xpath, "//tbody/tr[3]") { expect(page).to have_content('10') } + within('#legislation_proposals_list') do + within all('.legislation_proposal')[0] { expect(page).to have_content('30') } + within all('.legislation_proposal')[1] { expect(page).to have_content('20') } + within all('.legislation_proposal')[2] { expect(page).to have_content('10') } end end @@ -80,16 +74,10 @@ feature 'Admin legislation processes' do visit admin_legislation_process_proposals_path(process.id, order: :title) select "Id", from: "order-selector-participation" - within('#proposals_table') do - within(:xpath, "//tbody/tr[1]") do - expect(page).to have_content(proposal1.id) - end - within(:xpath, "//tbody/tr[2]") do - expect(page).to have_content(proposal2.id) - end - within(:xpath, "//tbody/tr[3]") do - expect(page).to have_content(proposal3.id) - end + within('#legislation_proposals_list') do + within all('.legislation_proposal')[0] { expect(page).to have_content(proposal1.id) } + within all('.legislation_proposal')[1] { expect(page).to have_content(proposal2.id) } + within all('.legislation_proposal')[2] { expect(page).to have_content(proposal3.id) } end end end