From e1cdb427d8cd3fdd0611c88f85be0c42c7f92d6a Mon Sep 17 00:00:00 2001 From: Stephen Hulme Date: Thu, 5 Oct 2023 16:27:27 +0100 Subject: [PATCH] style: lint --- app/views/layouts/application.html.erb | 18 +++++++++--------- .../views/layouts/application.html.erb_spec.rb | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ff544c8df9..026238ac4b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -19,19 +19,19 @@ <% # Define a hash of environments environments = { - cucumber: "๐Ÿฅ’", - development: "๐Ÿšง", - production: "๐ŸŒŽ", - profile: "โฑ๏ธ", - staging: "๐Ÿš€", - staging_2: "๐Ÿš€2๏ธโƒฃ", - test: "๐Ÿงช", - training: "๐ŸŽ“", + cucumber: '๐Ÿฅ’', + development: '๐Ÿšง', + production: '๐ŸŒŽ', + profile: 'โฑ๏ธ', + staging: '๐Ÿš€', + staging_2: '๐Ÿš€2๏ธโƒฃ', # rubocop:disable Naming/VariableNumber + test: '๐Ÿงช', + training: '๐ŸŽ“', } # Get an emoji for the current environment current_environment = Rails.env.to_sym - emoji = environments[current_environment] || "โ“" + emoji = environments[current_environment] || 'โ“' %> <%= "#{emoji}:" unless Rails.env.production? %> Sequencescape : <%= controller.controller_name.capitalize %> - <%= @page_name || controller.action_name %> diff --git a/spec/views/layouts/application.html.erb_spec.rb b/spec/views/layouts/application.html.erb_spec.rb index 05d89408ce..ffdde08fc8 100644 --- a/spec/views/layouts/application.html.erb_spec.rb +++ b/spec/views/layouts/application.html.erb_spec.rb @@ -4,14 +4,14 @@ RSpec.describe 'layouts/application', type: :view do environments = { - cucumber: "๐Ÿฅ’", - development: "๐Ÿšง", + cucumber: '๐Ÿฅ’', + development: '๐Ÿšง', # production is tested separately - profile: "โฑ๏ธ", - staging: "๐Ÿš€", - staging_2: "๐Ÿš€2๏ธโƒฃ", - test: "๐Ÿงช", - training: "๐ŸŽ“", + profile: 'โฑ๏ธ', + staging: '๐Ÿš€', + staging_2: '๐Ÿš€2๏ธโƒฃ', # rubocop:disable Naming/VariableNumber + test: '๐Ÿงช', + training: '๐ŸŽ“' } environments.each do |env, emoji| @@ -27,13 +27,13 @@ allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('production')) assign(:page_name, 'the homepage') render - expect(rendered).to have_title("Sequencescape : Test - the homepage") + expect(rendered).to have_title('Sequencescape : Test - the homepage') end it 'displays the correct title with question mark emoji for undefined environment' do allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('undefined_environment')) assign(:page_name, 'the homepage') render - expect(rendered).to have_title("โ“: Sequencescape : Test - the homepage") + expect(rendered).to have_title('โ“: Sequencescape : Test - the homepage') end end