fixes specs

This commit is contained in:
rgarcia
2016-03-29 18:47:49 +02:00
parent 98e895dec0
commit 34f9ce2ece
3 changed files with 7 additions and 17 deletions

View File

@@ -19,6 +19,7 @@ class Management::SpendingProposalsController < Management::BaseController
def show def show
@spending_proposal = SpendingProposal.find(params[:id]) @spending_proposal = SpendingProposal.find(params[:id])
set_spending_proposal_votes(@spending_proposal)
end end
private private
@@ -37,4 +38,9 @@ class Management::SpendingProposalsController < Management::BaseController
managed_user managed_user
end end
# This should not be necessary. Maybe we could create a specific show view for managers.
def set_spending_proposal_votes(spending_proposals)
@spending_proposal_votes = current_user ? current_user.spending_proposal_votes(spending_proposals) : {}
end
end end

View File

@@ -1,16 +0,0 @@
<% provide :title do %><%= t('spending_proposals.index.title') %><% end %>
<div class="page row-full">
<div class="row">
<div class="more-information text small-12 medium-8 column">
<h1><%= t('spending_proposals.index.title') %></h1>
<p><%= t('spending_proposals.index.text_html') %></p>
<% if can? :create, SpendingProposal %>
<%= link_to t('spending_proposals.index.create_link'), new_spending_proposal_path, class: 'button' %>
<% else %>
<p><%= t('spending_proposals.index.verified_only', verify_account: link_to(t('spending_proposals.index.verify_account'), verification_path)).html_safe %></p>
<% end %>
</div>
</div>
</div>

View File

@@ -26,7 +26,7 @@
</div> </div>
<div id="<%= dom_id(@spending_proposal) %>_votes" class="small-12 medium-3 column text-center"> <div id="<%= dom_id(@spending_proposal) %>_votes" class="small-12 medium-3 column text-center">
<%= render 'votes', <%= render 'spending_proposals/votes',
{ spending_proposal: @spending_proposal, vote_url: vote_spending_proposal_path(@spending_proposal, value: 'yes') } %> { spending_proposal: @spending_proposal, vote_url: vote_spending_proposal_path(@spending_proposal, value: 'yes') } %>
</div> </div>