From db90672fdd36d8536e0c52e4d36fc7c3e55d48f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 27 Sep 2019 19:49:25 +0200 Subject: [PATCH] Fix notifiable in-app topic specs These specs had never been tested before and were always broken. --- spec/factories/classifications.rb | 6 ++++++ spec/features/topics_spec.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/factories/classifications.rb b/spec/factories/classifications.rb index 5703bd3ff..bea7599ca 100644 --- a/spec/factories/classifications.rb +++ b/spec/factories/classifications.rb @@ -21,6 +21,12 @@ FactoryBot.define do sequence(:title) { |n| "Topic title #{n}" } sequence(:description) { |n| "Description as comment #{n}" } association :author, factory: :user + + trait :with_community do + community { create(:proposal).community } + end + + factory :topic_with_community, traits: [:with_community] end factory :related_content do diff --git a/spec/features/topics_spec.rb b/spec/features/topics_spec.rb index 6e88dc8ae..0bf07dd96 100644 --- a/spec/features/topics_spec.rb +++ b/spec/features/topics_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" describe "Topics" do context "Concerns" do - it_behaves_like "notifiable in-app", Topic + it_behaves_like "notifiable in-app", :topic_with_community end context "New" do