Don't show featured proposals in selected proposals list
This commit is contained in:
@@ -102,4 +102,8 @@ module ProposalsHelper
|
||||
def show_proposal_votes?
|
||||
params[:selected].blank?
|
||||
end
|
||||
|
||||
def show_featured_proposals?
|
||||
params[:selected].blank? && @featured_proposals.present?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<%= render "shared/banner" %>
|
||||
<% end %>
|
||||
|
||||
<% if @featured_proposals.present? %>
|
||||
<% if show_featured_proposals? %>
|
||||
<div id="featured-proposals" class="row featured-proposals">
|
||||
<div class="small-12 column">
|
||||
<h2>
|
||||
|
||||
@@ -962,6 +962,21 @@ feature "Proposals" do
|
||||
within("aside") { expect(page).not_to have_content "SUPPORTS" }
|
||||
within("aside") { expect(page).to have_content "Selected proposal" }
|
||||
end
|
||||
|
||||
scenario "do not show featured proposal in selected proposals list" do
|
||||
Setting["feature.featured_proposals"] = true
|
||||
create_featured_proposals
|
||||
|
||||
visit proposals_path
|
||||
|
||||
expect(page).to have_selector("#proposals .proposal-featured")
|
||||
expect(page).to have_selector("#featured-proposals")
|
||||
|
||||
click_link "Selected proposals"
|
||||
|
||||
expect(page).not_to have_selector("#proposals .proposal-featured")
|
||||
expect(page).not_to have_selector("#featured-proposals")
|
||||
end
|
||||
end
|
||||
|
||||
context "Search" do
|
||||
|
||||
Reference in New Issue
Block a user