+<%= form_tag(budget_executions_path(budget), method: :get, class: "budget-executions-filters") do %>
+
<%= label_tag :milestone_tag, t("budgets.executions.filters.milestone_tag.label") %>
<%= select_tag :milestone_tag,
options_for_select(
options_for_milestone_tags,
params[:milestone_tag]
),
- class: "js-submit-on-change",
prompt: t("budgets.executions.filters.milestone_tag.all",
count: budget.investments.winners.with_milestones.count) %>
+
<%= label_tag :status, t("budgets.executions.filters.status.label") %>
<%= select_tag :status,
options_from_collection_for_select(statuses,
:id, lambda { |s| "#{s.name} (#{filters_select_counts(s.id)})" },
params[:status]),
- class: "js-submit-on-change",
prompt: t("budgets.executions.filters.status.all",
count: budget.investments.winners.with_milestones.count) %>
+
+ <%= submit_tag t("shared.filter") %>
+
<% end %>
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml
index 9e7f326e9..650e44785 100644
--- a/config/locales/en/general.yml
+++ b/config/locales/en/general.yml
@@ -669,6 +669,7 @@ en:
back: "Go back to my content"
shared:
edit: "Edit"
+ filter: "Filter"
save: "Save"
delete: "Delete"
"yes": "Yes"
diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml
index 43e8cda0a..7c59338f9 100644
--- a/config/locales/es/general.yml
+++ b/config/locales/es/general.yml
@@ -669,6 +669,7 @@ es:
back: "Volver a mi contenido"
shared:
edit: "Editar"
+ filter: "Filtrar"
save: "Guardar"
delete: "Borrar"
"yes": "Si"
diff --git a/spec/system/budgets/executions_spec.rb b/spec/system/budgets/executions_spec.rb
index e1b362ad8..d9a789434 100644
--- a/spec/system/budgets/executions_spec.rb
+++ b/spec/system/budgets/executions_spec.rb
@@ -71,6 +71,7 @@ describe "Executions" do
expect(page).to have_content("No winner investments in this state")
select "Executed (0)", from: "Project's current state"
+ click_button "Filter"
expect(page).to have_content("No winner investments in this state")
end
@@ -166,16 +167,19 @@ describe "Executions" do
expect(page).to have_content(investment2.title)
select "Studying the project (1)", from: "Project's current state"
+ click_button "Filter"
expect(page).to have_content(investment1.title)
expect(page).not_to have_content(investment2.title)
select "Bidding (1)", from: "Project's current state"
+ click_button "Filter"
expect(page).to have_content(investment2.title)
expect(page).not_to have_content(investment1.title)
select "Executing the project (0)", from: "Project's current state"
+ click_button "Filter"
expect(page).not_to have_content(investment1.title)
expect(page).not_to have_content(investment2.title)
@@ -195,9 +199,13 @@ describe "Executions" do
click_link "Milestones"
select "Studying the project (0)", from: "Project's current state"
+ click_button "Filter"
+
expect(page).not_to have_content(investment1.title)
select "Bidding (1)", from: "Project's current state"
+ click_button "Filter"
+
expect(page).to have_content(investment1.title)
end
@@ -215,9 +223,13 @@ describe "Executions" do
click_link "Milestones"
select "Studying the project (1)", from: "Project's current state"
+ click_button "Filter"
+
expect(page).to have_content(investment1.title)
select "Bidding (0)", from: "Project's current state"
+ click_button "Filter"
+
expect(page).not_to have_content(investment1.title)
end
@@ -241,26 +253,26 @@ describe "Executions" do
expect(page).to have_content(investment2.title)
select "tag2 (2)", from: "Milestone tag"
-
- expect(page).to have_content(investment1.title)
- expect(page).to have_content(investment2.title)
-
select "Studying the project (1)", from: "Project's current state"
+ click_button "Filter"
expect(page).to have_content(investment1.title)
expect(page).not_to have_content(investment2.title)
select "Bidding (1)", from: "Project's current state"
+ click_button "Filter"
expect(page).not_to have_content(investment1.title)
expect(page).to have_content(investment2.title)
select "tag1 (1)", from: "Milestone tag"
+ click_button "Filter"
expect(page).not_to have_content(investment1.title)
expect(page).not_to have_content(investment2.title)
select "All (2)", from: "Milestone tag"
+ click_button "Filter"
expect(page).not_to have_content(investment1.title)
expect(page).to have_content(investment2.title)