OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix rubocop errors
Dombi Attilacee5dac27dbf
diff --git a/spec/components/rails_component_spec.rb b/spec/components/rails_component_spec.rbindex d37ed97ca44..19207e6a432 100644--- a/spec/components/rails_component_spec.rb+++ b/spec/components/rails_component_spec.rb@@ -38,30 +38,34 @@ describe RailsComponent, type: :component do{ context: }end- class TestComponent < described_class- include ViewComponent::InlineTemplate+ let(:test_component) do+ component = Class.new(described_class) do+ include ViewComponent::InlineTemplate- property :foo+ property :foo- erb_template <<~ERB- <%= foo %>- ERB+ erb_template <<~ERB+ <%= foo %>+ ERB- def link- link_to "<strong>HTML</strong>", '/foo/bar'- end+ def link+ link_to "<strong>HTML</strong>", '/foo/bar'+ end- def content- content_tag(:div) do- content_tag(:span) do- "<script>foo</script>"+ def content+ content_tag(:div) do+ content_tag(:span) do+ "<script>foo</script>"+ endendendend+ component.const_set("TestComponent", component)+ componentend- let(:component) { TestComponent.new(model, **options) }+ let(:component) { test_component.new(model, **options) }before doallow(controller).to receive(:view_context).and_return(action_view)@@ -70,6 +74,7 @@ describe RailsComponent, type: :component doshared_examples 'uses action_view helpers' dodescribe '#link' dosubject { component.link }+it 'uses link_to from rails with escaping' doexpect(subject).to eq %(<a href="/foo/bar"><strong>HTML</strong></a>)end@@ -77,6 +82,7 @@ describe RailsComponent, type: :component dodescribe '#foo' dosubject { component.call }+it 'escapes the property' dorender_inline componentexpect(subject).to include "<strong>Some HTML here!</strong>"@@ -85,6 +91,7 @@ describe RailsComponent, type: :component dodescribe '#content' dosubject { component.content }+it 'uses content_tag from rails with escaping', :aggregate_failures doexpect(subject).to eq "<div><span><script>foo</script></span></div>"end