Merge pull request #3692 from consul/admin-booth-assignments

Hide polls created by users on admin poll booth assigments
This commit is contained in:
Javier Martín
2019-09-12 12:54:42 +02:00
committed by GitHub
2 changed files with 11 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController
end
def booth_assignments
@polls = Poll.current
@polls = Poll.current.created_by_admin
end
def destroy

View File

@@ -31,6 +31,16 @@ describe "Admin booths assignments" do
expect(page).to have_content(second_booth.name)
end
scenario "Index do not show polls created by users from proposals dashboard" do
create(:poll, name: "Poll created by admin")
create(:poll, name: "Poll from user's proposal", related_type: "Proposal")
visit booth_assignments_admin_polls_path
expect(page).to have_content "Poll created by admin"
expect(page).not_to have_content "Poll from user's proposal"
end
scenario "Assign booth to poll", :js do
visit admin_poll_path(poll)
within("#poll-resources") do