Fixed some failing specs
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
module ProposalsDashboardHelper
|
module ProposalsDashboardHelper
|
||||||
def resources_menu_visible?(proposal, resources)
|
def resources_menu_visible?(proposal, resources)
|
||||||
can?(:manage_polls, proposal) && resources.any?
|
can?(:manage_polls, proposal) || resources.any?
|
||||||
end
|
end
|
||||||
|
|
||||||
def progress_menu(&block)
|
def progress_menu(&block)
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<% content_for :action_title, t("admin.polls.index.title") %>
|
<% content_for :action_title, t("admin.polls.index.title") %>
|
||||||
|
|
||||||
|
|
||||||
|
<% if @polls.any? %>
|
||||||
<%= link_to t("admin.polls.index.create"),
|
<%= link_to t("admin.polls.index.create"),
|
||||||
new_proposal_dashboard_poll_path(proposal),
|
new_proposal_dashboard_poll_path(proposal),
|
||||||
class: "button success float-right" %>
|
class: "button success float-right" %>
|
||||||
|
|
||||||
<% if @polls.any? %>
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<th class="medium-6"><%= t("admin.polls.index.name") %></th>
|
<th class="medium-6"><%= t("admin.polls.index.name") %></th>
|
||||||
@@ -19,4 +20,8 @@
|
|||||||
<div class="callout primary">
|
<div class="callout primary">
|
||||||
<%= t("admin.polls.index.no_polls") %>
|
<%= t("admin.polls.index.no_polls") %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= link_to t("admin.polls.index.create"),
|
||||||
|
new_proposal_dashboard_poll_path(proposal),
|
||||||
|
class: "button success float-right" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
<div class="off-canvas-wrapper">
|
<div class="off-canvas-wrapper">
|
||||||
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
|
<div class="off-canvas-wrapper-inner" data-off-canvas-wrapper>
|
||||||
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
|
<div class="off-canvas position-left" id="offCanvas" data-off-canvas>
|
||||||
|
|
||||||
<div class="show-for-small-only">
|
<div class="show-for-small-only">
|
||||||
<div class="dashboard-sidebar" data-equalizer-watch>
|
<div class="dashboard-sidebar" data-equalizer-watch>
|
||||||
<%= render partial: 'proposals_dashboard/menu' %>
|
<%= render partial: 'proposals_dashboard/menu' %>
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ feature 'Polls' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Initially there are no polls' do
|
scenario 'Initially there are no polls' do
|
||||||
|
within('#side_menu') do
|
||||||
click_link 'Polls'
|
click_link 'Polls'
|
||||||
|
end
|
||||||
|
|
||||||
expect(page).to have_content('There are no polls coming up.')
|
expect(page).to have_content('There are no polls coming up.')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -442,7 +442,9 @@ feature 'Proposals' do
|
|||||||
expect(page.html).not_to include "<script>alert('hey')</script>"
|
expect(page.html).not_to include "<script>alert('hey')</script>"
|
||||||
|
|
||||||
click_link 'Dashboard'
|
click_link 'Dashboard'
|
||||||
|
within('#side_menu') do
|
||||||
click_link 'Edit'
|
click_link 'Edit'
|
||||||
|
end
|
||||||
|
|
||||||
expect(page).to have_current_path(edit_proposal_path(Proposal.last))
|
expect(page).to have_current_path(edit_proposal_path(Proposal.last))
|
||||||
expect(page).not_to have_link('click me')
|
expect(page).not_to have_link('click me')
|
||||||
@@ -518,7 +520,10 @@ feature 'Proposals' do
|
|||||||
click_link 'Dashboard'
|
click_link 'Dashboard'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
within('#side_menu') do
|
||||||
click_link 'Retire'
|
click_link 'Retire'
|
||||||
|
end
|
||||||
|
|
||||||
expect(page).to have_current_path(retire_form_proposal_path(proposal))
|
expect(page).to have_current_path(retire_form_proposal_path(proposal))
|
||||||
|
|
||||||
select 'Duplicated', from: 'proposal_retired_reason'
|
select 'Duplicated', from: 'proposal_retired_reason'
|
||||||
|
|||||||
Reference in New Issue
Block a user