Infer type for component specs automatically

This commit is contained in:
Javi Martín
2021-08-17 22:07:39 +02:00
parent e5cd763385
commit 4cbf945228
51 changed files with 54 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
require "rails_helper"
describe Widget::Feeds::DebateComponent, type: :component do
describe Widget::Feeds::DebateComponent do
let(:debate) { create(:debate, sdg_goals: [SDG::Goal[1]]) }
let(:component) { Widget::Feeds::DebateComponent.new(debate) }

View File

@@ -1,6 +1,6 @@
require "rails_helper"
describe Widget::Feeds::FeedComponent, type: :component do
describe Widget::Feeds::FeedComponent do
it "renders a message when there are no items" do
feed = double(kind: "debates", items: [])
component = Widget::Feeds::FeedComponent.new(feed)

View File

@@ -1,6 +1,6 @@
require "rails_helper"
describe Widget::Feeds::ProcessComponent, type: :component do
describe Widget::Feeds::ProcessComponent do
let(:process) { create(:legislation_process, sdg_goals: [SDG::Goal[1]]) }
let(:component) { Widget::Feeds::ProcessComponent.new(process) }

View File

@@ -1,6 +1,6 @@
require "rails_helper"
describe Widget::Feeds::ProposalComponent, type: :component do
describe Widget::Feeds::ProposalComponent do
let(:proposal) { create(:proposal, sdg_goals: [SDG::Goal[1]]) }
let(:component) { Widget::Feeds::ProposalComponent.new(proposal) }