Fix term in investments advanced search results
When using the advanced search in the debates and proposals sections, we were not displaying the search term in the search results summary. However, we were displaying it when using the advanced search in the investments section. Now we're doing the same thing everywhere.
This commit is contained in:
@@ -28,9 +28,11 @@
|
||||
<h2><%= t("shared.search_results") %></h2>
|
||||
<p>
|
||||
<%= page_entries_info @investments %>
|
||||
<% if params[:advanced_search].blank? %>
|
||||
<%= sanitize(t("budgets.investments.index.search_results",
|
||||
count: @investments.size,
|
||||
search_term: params[:search])) %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -175,6 +175,8 @@ describe "Budget Investments" do
|
||||
click_button "Search"
|
||||
end
|
||||
|
||||
expect(page).to have_content "containing the term 'Schwifty'"
|
||||
|
||||
within("#budget-investments") do
|
||||
expect(page).to have_css(".budget-investment", count: 2)
|
||||
|
||||
@@ -199,9 +201,10 @@ describe "Budget Investments" do
|
||||
select "Last 24 hours", from: "By date"
|
||||
click_button "Filter"
|
||||
|
||||
expect(page).to have_content "There is 1 investment containing the term 'environment'"
|
||||
expect(page).to have_content "There is 1 investment"
|
||||
expect(page).to have_css ".budget-investment", count: 1
|
||||
expect(page).to have_content "Feasible environment"
|
||||
expect(page).not_to have_content "containing the term"
|
||||
expect(page).not_to have_content "Feasible health"
|
||||
expect(page).not_to have_content "Unfeasible environment"
|
||||
expect(page).not_to have_content "Unfeasible health"
|
||||
@@ -209,9 +212,10 @@ describe "Budget Investments" do
|
||||
click_link "Unfeasible"
|
||||
|
||||
expect(page).not_to have_content "Feasible environment"
|
||||
expect(page).to have_content "There is 1 investment containing the term 'environment'"
|
||||
expect(page).to have_content "There is 1 investment"
|
||||
expect(page).to have_css ".budget-investment", count: 1
|
||||
expect(page).to have_content "Unfeasible environment"
|
||||
expect(page).not_to have_content "containing the term"
|
||||
expect(page).not_to have_content "Feasible health"
|
||||
expect(page).not_to have_content "Unfeasible health"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user