~cytrogen/masto-fe

bdc74086e6e7224117cfb46b1f5e7540c4580485 — Matt Jankowski 2 years ago 6e226f5
Fix Rails/ContentTag cop (#24691)

M .rubocop_todo.yml => .rubocop_todo.yml +0 -6
@@ 1213,12 1213,6 @@ Rails/CompactBlank:
    - 'app/services/import_service.rb'
    - 'config/initializers/paperclip.rb'

# This cop supports safe autocorrection (--autocorrect).
Rails/ContentTag:
  Exclude:
    - 'app/helpers/application_helper.rb'
    - 'app/helpers/branding_helper.rb'

# Configuration parameters: Include.
# Include: db/migrate/*.rb
Rails/CreateTableWithTimestamps:

M app/helpers/application_helper.rb => app/helpers/application_helper.rb +2 -2
@@ 118,7 118,7 @@ module ApplicationHelper
  end

  def check_icon
    content_tag(:svg, tag(:path, 'fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z'), xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 20 20', fill: 'currentColor')
    content_tag(:svg, tag.path('fill-rule': 'evenodd', 'clip-rule': 'evenodd', d: 'M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z'), xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 20 20', fill: 'currentColor')
  end

  def visibility_icon(status)


@@ 152,7 152,7 @@ module ApplicationHelper
  end

  def opengraph(property, content)
    tag(:meta, content: content, property: property)
    tag.meta(content: content, property: property)
  end

  def body_classes

M app/helpers/branding_helper.rb => app/helpers/branding_helper.rb +2 -2
@@ 11,11 11,11 @@ module BrandingHelper
  end

  def _logo_as_symbol_wordmark
    content_tag(:svg, tag(:use, href: '#logo-symbol-wordmark'), viewBox: '0 0 261 66', class: 'logo logo--wordmark')
    content_tag(:svg, tag.use(href: '#logo-symbol-wordmark'), viewBox: '0 0 261 66', class: 'logo logo--wordmark')
  end

  def _logo_as_symbol_icon
    content_tag(:svg, tag(:use, href: '#logo-symbol-icon'), viewBox: '0 0 79 79', class: 'logo logo--icon')
    content_tag(:svg, tag.use(href: '#logo-symbol-icon'), viewBox: '0 0 79 79', class: 'logo logo--icon')
  end

  def render_logo

M spec/views/statuses/show.html.haml_spec.rb => spec/views/statuses/show.html.haml_spec.rb +6 -6
@@ 29,10 29,10 @@ describe 'statuses/show.html.haml', without_verify_partial_doubles: true do

    header_tags = view.content_for(:header_tags)

    expect(header_tags).to match(%r{<meta content=".+" property="og:title" />})
    expect(header_tags).to match(%r{<meta content="article" property="og:type" />})
    expect(header_tags).to match(%r{<meta content=".+" property="og:image" />})
    expect(header_tags).to match(%r{<meta content="http://.+" property="og:url" />})
    expect(header_tags).to match(/<meta content=".+" property="og:title">/)
    expect(header_tags).to match(/<meta content="article" property="og:type">/)
    expect(header_tags).to match(/<meta content=".+" property="og:image">/)
    expect(header_tags).to match(%r{<meta content="http://.+" property="og:url">})
  end

  it 'has twitter player tag' do


@@ 48,7 48,7 @@ describe 'statuses/show.html.haml', without_verify_partial_doubles: true do

    header_tags = view.content_for(:header_tags)

    expect(header_tags).to match(%r{<meta content="http://.+/media/.+/player" property="twitter:player" />})
    expect(header_tags).to match(%r{<meta content="player" property="twitter:card" />})
    expect(header_tags).to match(%r{<meta content="http://.+/media/.+/player" property="twitter:player">})
    expect(header_tags).to match(/<meta content="player" property="twitter:card">/)
  end
end