decidim-proposals/spec/features/proposals_spec.rb in decidim-0.3.1 vs decidim-proposals/spec/features/proposals_spec.rb in decidim-0.3.2

- old
+ new

@@ -677,9 +677,28 @@ within "form.new_filter" do expect(page).not_to have_content(/State/i) end end end + + context "when the user is logged in" do + before do + login_as user, scope: :user + end + + it "can be filtered by category" do + create_list(:proposal, 3, feature: feature) + create(:proposal, feature: feature, category: category) + + visit_feature + + within "form.new_filter" do + select category.name[I18n.locale.to_s], from: "filter_category_id" + end + + expect(page).to have_css(".card--proposal", count: 1) + end + end end context "when ordering" do context "by 'most_voted'" do let!(:feature) do