From 4be4d967100615fffffbf6b623e8d5fed5be89c4 Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Fri, 24 May 2019 16:53:40 +0200 Subject: [PATCH] Don't show order links in selected proposals list --- app/views/proposals/index.html.erb | 4 +++- spec/features/proposals_spec.rb | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/views/proposals/index.html.erb b/app/views/proposals/index.html.erb index 90e06d272..1c979099c 100644 --- a/app/views/proposals/index.html.erb +++ b/app/views/proposals/index.html.erb @@ -82,7 +82,9 @@ search_path: proposals_path(page: 1) %> <% end %> - <%= render "shared/order_links", i18n_namespace: "proposals.index" %> + <% unless params[:selected].present? %> + <%= render "shared/order_links", i18n_namespace: "proposals.index" %> + <% end %> <% if @proposals.any? %>
diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 937877957..698a43961 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -997,6 +997,22 @@ feature "Proposals" do expect(page).not_to have_link "Recommended" expect(page).not_to have_link "See more recommendations" end + + scenario "do not show order links in selected proposals list" do + visit proposals_path + + expect(page).to have_css "ul.submenu" + expect(page).to have_link "most active" + expect(page).to have_link "highest rated" + expect(page).to have_link "newest" + + click_link "Selected proposals" + + expect(page).not_to have_css "ul.submenu" + expect(page).not_to have_link "most active" + expect(page).not_to have_link "highest rated" + expect(page).not_to have_link "newest" + end end context "Search" do