removes booths link from admin menu

This commit is contained in:
Juanjo Bazán
2016-10-19 13:44:05 +02:00
committed by kikito
parent 96cf578259
commit 0dd122833a
2 changed files with 5 additions and 60 deletions

View File

@@ -95,14 +95,6 @@
<% end %> <% end %>
</li> </li>
<% if Poll.any? %>
<li <%= 'class=active' if controller_name == 'booths' %>>
<%= link_to admin_poll_booths_url(Poll.last) do %>
<span class="icon-user"></span><%= t('admin.menu.booths') %>
<% end %>
</li>
<% end %>
<li <%= 'class=active' if controller_name == 'activity' %>> <li <%= 'class=active' if controller_name == 'activity' %>>
<%= link_to admin_activity_path do %> <%= link_to admin_activity_path do %>
<span class="icon-eye"></span><%= t('admin.menu.activity') %> <span class="icon-eye"></span><%= t('admin.menu.activity') %>

View File

@@ -13,32 +13,24 @@ feature 'Admin booths' do
visit admin_root_path visit admin_root_path
within('#side_menu') do within('#side_menu') do
click_link "Booths" click_link "Polls"
end end
click_link poll.name
expect(page).to have_content "There are no booths in this poll" expect(page).to have_content "There are no booths in this poll"
end 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 scenario 'Index' do
3.times { create(:poll_booth, poll: poll) } 3.times { create(:poll_booth, poll: poll) }
visit admin_root_path visit admin_root_path
within('#side_menu') do within('#side_menu') do
click_link "Booths" click_link "Polls"
end end
expect(page).to have_css ".booth", count: 3 click_link poll.name
booths = Poll::Booth.all booths = Poll::Booth.all
booths.each do |booth| booths.each do |booth|
@@ -50,45 +42,6 @@ feature 'Admin booths' do
expect(page).to_not have_content "There are no booths" expect(page).to_not have_content "There are no booths"
end 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 scenario 'Show' do
booth = create(:poll_booth, poll: poll) booth = create(:poll_booth, poll: poll)