adds booth_assignment show with officers and recounts info

This commit is contained in:
Juanjo Bazán
2017-01-04 21:00:36 +01:00
parent 2bd6e121c7
commit 70b86170a2
10 changed files with 127 additions and 105 deletions

View File

@@ -39,7 +39,7 @@ feature 'Admin booths assignments' do
scenario 'remove booth from poll', :js do
poll = create(:poll)
booth = create(:poll_booth)
create(:poll_booth_assignment, poll: poll, booth: booth)
assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
visit admin_poll_path(poll)
within('#poll-resources') do
@@ -49,7 +49,7 @@ feature 'Admin booths assignments' do
expect(page).to_not have_content 'There are no booths assigned to this poll.'
expect(page).to have_content booth.name
within("#booth_#{booth.id}") do
within("#poll_booth_assignment_#{assignment.id}") do
click_link 'Remove booth from poll'
end

View File

@@ -98,7 +98,7 @@ feature 'Admin polls' do
context "Poll show" do
scenario "No booths", :js do
scenario "No booths" do
poll = create(:poll)
visit admin_poll_path(poll)
click_link "Booths (0)"
@@ -106,7 +106,7 @@ feature 'Admin polls' do
expect(page).to have_content "There are no booths assigned to this poll."
end
scenario "Booth list", :js do
scenario "Booth list" do
poll = create(:poll)
3.times { create(:poll_booth, polls: [poll]) }
@@ -115,11 +115,10 @@ feature 'Admin polls' do
expect(page).to have_css ".booth", count: 3
booths = Poll::Booth.all
booths.each do |booth|
within("#booth_#{booth.id}") do
expect(page).to have_content booth.name
expect(page).to have_content booth.location
poll.booth_assignments.each do |ba|
within("#poll_booth_assignment_#{ba.id}") do
expect(page).to have_content ba.booth.name
expect(page).to have_content ba.booth.location
end
end
expect(page).to_not have_content "There are no booths assigned to this poll."