From bf5021c6a506a3e193b25634b447b7c3bd1239ec Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 13 Oct 2017 18:11:41 +0200 Subject: [PATCH] changes back link to available booths when manage shifts --- app/views/admin/poll/shifts/new.html.erb | 2 +- spec/features/admin/poll/booths_spec.rb | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/views/admin/poll/shifts/new.html.erb b/app/views/admin/poll/shifts/new.html.erb index b975c40a9..4e0665ea2 100644 --- a/app/views/admin/poll/shifts/new.html.erb +++ b/app/views/admin/poll/shifts/new.html.erb @@ -1,4 +1,4 @@ -<%= back_link_to admin_booths_path %> +<%= back_link_to available_admin_booths_path %>

<%= @booth.name %>

diff --git a/spec/features/admin/poll/booths_spec.rb b/spec/features/admin/poll/booths_spec.rb index 4eeb81cb6..1aa487b26 100644 --- a/spec/features/admin/poll/booths_spec.rb +++ b/spec/features/admin/poll/booths_spec.rb @@ -113,4 +113,18 @@ feature 'Admin booths' do end end + scenario "Back link go back to available list when manage shifts" do + poll = create(:poll, :current) + booth = create(:poll_booth) + assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + + visit available_admin_booths_path + + within("#booth_#{booth.id}") do + click_link "Manage shifts" + end + + click_link "Go back" + expect(current_path).to eq(available_admin_booths_path) + end end