From 0dd122833a6f71403af30f5c6be2873bf3d145b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Wed, 19 Oct 2016 13:44:05 +0200 Subject: [PATCH] removes booths link from admin menu --- app/views/admin/_menu.html.erb | 8 ---- spec/features/admin/poll/booths_spec.rb | 57 +++---------------------- 2 files changed, 5 insertions(+), 60 deletions(-) diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 0661a3bb6..11e46814d 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -95,14 +95,6 @@ <% end %> - <% if Poll.any? %> -
  • > - <%= link_to admin_poll_booths_url(Poll.last) do %> - <%= t('admin.menu.booths') %> - <% end %> -
  • - <% end %> -
  • > <%= link_to admin_activity_path do %> <%= t('admin.menu.activity') %> diff --git a/spec/features/admin/poll/booths_spec.rb b/spec/features/admin/poll/booths_spec.rb index ad46c67fb..eff653dfe 100644 --- a/spec/features/admin/poll/booths_spec.rb +++ b/spec/features/admin/poll/booths_spec.rb @@ -13,32 +13,24 @@ feature 'Admin booths' do visit admin_root_path within('#side_menu') do - click_link "Booths" + click_link "Polls" end + click_link poll.name + expect(page).to have_content "There are no booths in this poll" end - scenario 'No link to booths when no polls' do - Poll.destroy_all - - visit admin_root_path - - within('#side_menu') do - expect(page).to_not have_link "Booths" - end - end - scenario 'Index' do 3.times { create(:poll_booth, poll: poll) } visit admin_root_path within('#side_menu') do - click_link "Booths" + click_link "Polls" end - expect(page).to have_css ".booth", count: 3 + click_link poll.name booths = Poll::Booth.all booths.each do |booth| @@ -50,45 +42,6 @@ feature 'Admin booths' do expect(page).to_not have_content "There are no booths" end - scenario "Index default to last poll" do - poll1 = create(:poll) - poll2 = create(:poll) - - booth1 = create(:poll_booth, poll: poll1) - booth2 = create(:poll_booth, poll: poll2) - - visit admin_root_path - - within('#side_menu') do - click_link "Booths" - end - - expect(page).to have_css ".booth", count: 1 - expect(page).to have_content booth2.name - expect(page).to_not have_content booth1.name - end - - scenario "Index select poll", :js do - poll1 = create(:poll) - poll2 = create(:poll) - - booth1 = create(:poll_booth, poll: poll1) - booth2 = create(:poll_booth, poll: poll2) - - visit admin_root_path - - within('#side_menu') do - click_link "Booths" - end - - select poll1.name, from: "poll_id" - - expect(page).to have_content "List of booths of poll #{poll1.name}" - expect(page).to have_css ".booth", count: 1 - expect(page).to have_content booth1.name - expect(page).to_not have_content booth2.name - end - scenario 'Show' do booth = create(:poll_booth, poll: poll)