Use symbols instead of constants for behaviours
This way we can be more flexible about the factory we can pass as parameter.
This commit is contained in:
@@ -14,7 +14,7 @@ describe "Budget Investments" do
|
||||
"budget_investment_path"
|
||||
|
||||
context "Concerns" do
|
||||
it_behaves_like "notifiable in-app", Budget::Investment
|
||||
it_behaves_like "notifiable in-app", :budget_investment
|
||||
it_behaves_like "relationable", Budget::Investment
|
||||
it_behaves_like "remotely_translatable",
|
||||
:budget_investment,
|
||||
|
||||
@@ -8,7 +8,7 @@ describe "Commenting legislation questions" do
|
||||
let(:legislation_question) { create :legislation_question, process: process }
|
||||
|
||||
context "Concerns" do
|
||||
it_behaves_like "notifiable in-app", Legislation::Question
|
||||
it_behaves_like "notifiable in-app", :legislation_question
|
||||
end
|
||||
|
||||
scenario "Index" do
|
||||
|
||||
@@ -9,7 +9,7 @@ describe "Debates" do
|
||||
end
|
||||
|
||||
context "Concerns" do
|
||||
it_behaves_like "notifiable in-app", Debate
|
||||
it_behaves_like "notifiable in-app", :debate
|
||||
it_behaves_like "relationable", Debate
|
||||
it_behaves_like "remotely_translatable",
|
||||
:debate,
|
||||
|
||||
@@ -8,7 +8,7 @@ describe "Legislation Proposals" do
|
||||
let(:proposal) { create(:legislation_proposal) }
|
||||
|
||||
context "Concerns" do
|
||||
it_behaves_like "notifiable in-app", Legislation::Proposal
|
||||
it_behaves_like "notifiable in-app", :legislation_proposal
|
||||
end
|
||||
|
||||
scenario "Only one menu element has 'active' CSS selector" do
|
||||
|
||||
@@ -3,7 +3,7 @@ require "rails_helper"
|
||||
describe "Polls" do
|
||||
|
||||
context "Concerns" do
|
||||
it_behaves_like "notifiable in-app", Poll
|
||||
it_behaves_like "notifiable in-app", :poll
|
||||
end
|
||||
|
||||
context "#index" do
|
||||
|
||||
@@ -13,7 +13,7 @@ describe "Proposals" do
|
||||
end
|
||||
|
||||
context "Concerns" do
|
||||
it_behaves_like "notifiable in-app", Proposal
|
||||
it_behaves_like "notifiable in-app", :proposal
|
||||
it_behaves_like "relationable", Proposal
|
||||
it_behaves_like "remotely_translatable",
|
||||
:proposal,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
shared_examples "notifiable in-app" do |described_class|
|
||||
shared_examples "notifiable in-app" do |factory_name|
|
||||
|
||||
let(:author) { create(:user, :verified) }
|
||||
let!(:notifiable) { create(model_name(described_class), author: author) }
|
||||
let!(:notifiable) { create(factory_name, author: author) }
|
||||
|
||||
scenario "Notification icon is shown" do
|
||||
create(:notification, notifiable: notifiable, user: author)
|
||||
|
||||
Reference in New Issue
Block a user