-
- <% if @tag_filter %>
-
- <%= t("debates.index.filter_topic",
- number: @debates.size,
- # TODO translation
- topic: @tag_filter).html_safe %>
-
- <% else %>
-
Filtrar por tema:
+
+ <% if @tag_filter %>
+
+ <%= t("debates.index.filter_topic",
+ number: @debates.size,
+ topic: @tag_filter).html_safe %>
+
+ <% else %>
+ <%= t("debates.index.select_topic") %>
+
+ <% end %>
+
+
+
+
<%= t("debates.index.select_order") %>
- <% end %>
+
+
diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb
index 9018777d3..c4d4d4487 100644
--- a/spec/features/debates_spec.rb
+++ b/spec/features/debates_spec.rb
@@ -410,16 +410,15 @@ feature 'Debates' do
feature 'Debates can be filtered by tags', :js do
let!(:debate1) { create(:debate, tag_list: ["Deporte", "Corrupción"]) }
- let!(:debate2) { create(:debate, tag_list: ["Deporte", "Corrupción", "Fiestas populares"]) }
+ let!(:debate2) { create(:debate, tag_list: ["Deporte", "Fiestas populares"]) }
let!(:debate3) { create(:debate, tag_list: ["Corrupción", "Fiestas populares"]) }
scenario 'By default no tag filter is applied' do
visit debates_path
- expect(page).to have_content('Filtrar por tema')
- expect(page).not_to have_content('con el tema')
+ expect(page).to have_content('Filter by topic')
+ expect(page).not_to have_content('with the topic')
expect(page).to have_selector('#debates .debate', count: 3)
- expect(current_url).to_not include('tag=')
end
scenario 'Debates are filtered by single tag' do
@@ -427,17 +426,15 @@ feature 'Debates' do
select('Deporte', from: 'tag-filter')
- expect(page).not_to have_content('Filtrar por tema')
- expect(page).to have_content('with the topic')
+ expect(page).not_to have_content('Filter by topic')
expect(page).not_to have_select('tag-filter')
+ expect(page).to have_content('with the topic')
expect(current_url).to include('tag=Deporte')
- expect(page).to have_selector('#debates .debate', count: 2)
+ expect(page).to have_selector('#debates .debate', count: 2)
expect(page).to_not have_content(debate3.title)
expect(page).to have_content(debate1.title)
expect(page).to have_content(debate2.title)
end
-
end
-
end