A platform for community discussion. Free, open, simple.
DEV: Enable `Style/SingleLineMethods` and `Style/Semicolon` in Rubocop (#6717)
David Taylor9248ad190524
diff --git a/.rubocop.yml b/.rubocop.ymlindex e28a0876aa1..9f2254dd3a6 100644--- a/.rubocop.yml+++ b/.rubocop.yml@@ -114,3 +114,10 @@ Layout/AlignHash:Bundler/OrderedGems:Enabled: false++Style/SingleLineMethods:+ Enabled: true++Style/Semicolon:+ Enabled: true+ AllowAsExpressionSeparator: true\ No newline at end of filediff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rbindex fec948e8be0..2d353702258 100644--- a/app/mailers/user_notifications.rb+++ b/app/mailers/user_notifications.rb@@ -575,7 +575,7 @@ class UserNotifications < ActionMailer::Baseif SiteSetting.private_email?message = I18n.t('system_messages.contents_hidden')else- message = email_post_markdown(post) + (reached_limit ? "\n\n#{I18n.t "user_notifications.reached_limit", count: SiteSetting.max_emails_per_day_per_user}" : "");+ message = email_post_markdown(post) + (reached_limit ? "\n\n#{I18n.t "user_notifications.reached_limit", count: SiteSetting.max_emails_per_day_per_user}" : "")endfirst_footer_classes = "hilight"diff --git a/app/models/backup_location_site_setting.rb b/app/models/backup_location_site_setting.rbindex aef3c89fec3..4763c3be047 100644--- a/app/models/backup_location_site_setting.rb+++ b/app/models/backup_location_site_setting.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-require_dependency 'enum_site_setting';+require_dependency 'enum_site_setting'class BackupLocationSiteSetting < EnumSiteSettingLOCAL ||= "local"diff --git a/app/models/queued_post.rb b/app/models/queued_post.rbindex a4067f8c57a..92cc688fa96 100644--- a/app/models/queued_post.rb+++ b/app/models/queued_post.rb@@ -1,6 +1,6 @@class QueuedPost < ActiveRecord::Base- class InvalidStateTransition < StandardError; end;+ class InvalidStateTransition < StandardError; endbelongs_to :userbelongs_to :topicdiff --git a/db/migrate/20150818190757_create_embeddable_hosts.rb b/db/migrate/20150818190757_create_embeddable_hosts.rbindex c5ae2ac36a8..fc52e7bb8c8 100644--- a/db/migrate/20150818190757_create_embeddable_hosts.rb+++ b/db/migrate/20150818190757_create_embeddable_hosts.rb@@ -6,7 +6,7 @@ class CreateEmbeddableHosts < ActiveRecord::Migration[4.2]t.timestamps null: falseend- category_id = 0;+ category_id = 0category_row = execute("SELECT c.id FROM categories AS cINNER JOIN site_settings AS s ON s.value = c.nameWHERE s.name = 'embed_category'")diff --git a/lib/autospec/qunit_runner.rb b/lib/autospec/qunit_runner.rbindex 6598207c74a..91e3d3983cb 100644--- a/lib/autospec/qunit_runner.rb+++ b/lib/autospec/qunit_runner.rb@@ -5,8 +5,12 @@ module Autospecclass QunitRunner < BaseRunnerWATCHERS = {}- def self.watch(pattern, &blk); WATCHERS[pattern] = blk; end- def watchers; WATCHERS; end+ def self.watch(pattern, &blk)+ WATCHERS[pattern] = blk+ end+ def watchers+ WATCHERS+ end# Discourse specificwatch(%r{^app/assets/javascripts/discourse/(.+)\.js.es6$}) { |m| "test/javascripts/#{m[1]}-test.js.es6" }@@ -14,8 +18,12 @@ module Autospecwatch(%r{^test/javascripts/.+\.js.es6$})RELOADERS = Set.new- def self.reload(pattern); RELOADERS << pattern; end- def reloaders; RELOADERS; end+ def self.reload(pattern)+ RELOADERS << pattern+ end+ def reloaders+ RELOADERS+ end# Discourse specificreload(%r{^test/javascripts/fixtures/.+_fixtures\.js(\.es6)?$})diff --git a/lib/autospec/rspec_runner.rb b/lib/autospec/rspec_runner.rbindex e8848c6937a..64cb0302080 100644--- a/lib/autospec/rspec_runner.rb+++ b/lib/autospec/rspec_runner.rb@@ -3,8 +3,12 @@ module Autospecclass RspecRunner < BaseRunnerWATCHERS = {}- def self.watch(pattern, &blk); WATCHERS[pattern] = blk; end- def watchers; WATCHERS; end+ def self.watch(pattern, &blk)+ WATCHERS[pattern] = blk+ end+ def watchers+ WATCHERS+ end# Discourse specificwatch(%r{^lib/(.+)\.rb$}) { |m| "spec/components/#{m[1]}_spec.rb" }@@ -30,8 +34,12 @@ module Autospecwatch(%r{^(plugins/.*)/lib/(.*)\.rb}) { |m| "#{m[1]}/spec/lib/#{m[2]}_spec.rb" }RELOADERS = Set.new- def self.reload(pattern); RELOADERS << pattern; end- def reloaders; RELOADERS; end+ def self.reload(pattern)+ RELOADERS << pattern+ end+ def reloaders+ RELOADERS+ end# we are using a simple runner at the moment, whole idea of using a reloader is no longer neededwatch("spec/rails_helper.rb")diff --git a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rbindex 10802feaac9..f45884fb8b5 100644--- a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb+++ b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb@@ -28,7 +28,7 @@ module Tiltctx = MiniRacer::Context.new(timeout: 15000)ctx.eval("var self = this; #{File.read("#{Rails.root}/vendor/assets/javascripts/babel.js")}")ctx.eval(File.read(Ember::Source.bundled_path_for('ember-template-compiler.js')))- ctx.eval("module = {}; exports = {};");+ ctx.eval("module = {}; exports = {};")ctx.attach("rails.logger.info", proc { |err| Rails.logger.info(err.to_s) })ctx.attach("rails.logger.error", proc { |err| Rails.logger.error(err.to_s) })ctx.eval <<JSdiff --git a/lib/guardian.rb b/lib/guardian.rbindex 0f8d5689b2d..f06ec7c051b 100644--- a/lib/guardian.rb+++ b/lib/guardian.rb@@ -19,17 +19,39 @@ class Guardianinclude TagGuardianclass AnonymousUser- def blank?; true; end- def admin?; false; end- def staff?; false; end- def moderator?; false; end- def approved?; false; end- def staged?; false; end- def silenced?; false; end- def secure_category_ids; []; end- def topic_create_allowed_category_ids; []; end- def has_trust_level?(level); false; end- def email; nil; end+ def blank?+ true+ end+ def admin?+ false+ end+ def staff?+ false+ end+ def moderator?+ false+ end+ def approved?+ false+ end+ def staged?+ false+ end+ def silenced?+ false+ end+ def secure_category_ids+ []+ end+ def topic_create_allowed_category_ids+ []+ end+ def has_trust_level?(level)+ false+ end+ def email+ nil+ endendattr_accessor :can_see_emailsdiff --git a/lib/html_to_markdown.rb b/lib/html_to_markdown.rbindex 3f362e6f945..a213611ea3f 100644--- a/lib/html_to_markdown.rb+++ b/lib/html_to_markdown.rb@@ -3,7 +3,9 @@ require "nokogiri"class HtmlToMarkdownclass Block < Struct.new(:name, :head, :body, :opened, :markdown)- def initialize(name, head = "", body = "", opened = false, markdown = ""); super; end+ def initialize(name, head = "", body = "", opened = false, markdown = "")+ super+ endenddef initialize(html, opts = {})diff --git a/lib/migration/safe_migrate.rb b/lib/migration/safe_migrate.rbindex d777f095bd0..4ec48aa8f7b 100644--- a/lib/migration/safe_migrate.rb+++ b/lib/migration/safe_migrate.rb@@ -50,7 +50,9 @@ class Migration::SafeMigratesuperrescue => eif e.cause.is_a?(Discourse::InvalidMigration)- def e.cause; nil; end+ def e.cause+ nil+ enddef e.backtracesuper.reject do |frame|frame =~ /safe_migrate\.rb/ || frame =~ /schema_migration_details\.rb/diff --git a/lib/stylesheet/compiler.rb b/lib/stylesheet/compiler.rbindex 5aff8dfdba4..8cba8e677bc 100644--- a/lib/stylesheet/compiler.rb+++ b/lib/stylesheet/compiler.rb@@ -32,7 +32,7 @@ module Stylesheetenddef self.compile(stylesheet, filename, options = {})- source_map_file = options[:source_map_file] || "#{filename.sub(".scss", "")}.css.map";+ source_map_file = options[:source_map_file] || "#{filename.sub(".scss", "")}.css.map"engine = SassC::Engine.new(stylesheet,importer: Importer,diff --git a/lib/validators/allow_user_locale_enabled_validator.rb b/lib/validators/allow_user_locale_enabled_validator.rbindex 73d3cb5c51b..09a283212c4 100644--- a/lib/validators/allow_user_locale_enabled_validator.rb+++ b/lib/validators/allow_user_locale_enabled_validator.rb@@ -12,7 +12,7 @@ class AllowUserLocaleEnabledValidatorenddef error_message- I18n.t("site_settings.errors.user_locale_not_enabled");+ I18n.t("site_settings.errors.user_locale_not_enabled")endenddiff --git a/script/bulk_import/base.rb b/script/bulk_import/base.rbindex 0ac869d96ef..9401fc16fd5 100644--- a/script/bulk_import/base.rb+++ b/script/bulk_import/base.rb@@ -183,14 +183,28 @@ class BulkImport::Base@raw_connection.exec("SELECT setval('#{PostAction.sequence_name}', #{@last_post_action_id})") if @last_post_action_id > 0end- def group_id_from_imported_id(id); @groups[id.to_s]; end- def user_id_from_imported_id(id); @users[id.to_s]; end- def category_id_from_imported_id(id); @categories[id.to_s]; end- def topic_id_from_imported_id(id); @topics[id.to_s]; end- def post_id_from_imported_id(id); @posts[id.to_s]; end+ def group_id_from_imported_id(id)+ @groups[id.to_s]+ end+ def user_id_from_imported_id(id)+ @users[id.to_s]+ end+ def category_id_from_imported_id(id)+ @categories[id.to_s]+ end+ def topic_id_from_imported_id(id)+ @topics[id.to_s]+ end+ def post_id_from_imported_id(id)+ @posts[id.to_s]+ end- def post_number_from_imported_id(id); @post_number_by_post_id[post_id_from_imported_id(id)]; end- def topic_id_from_imported_post_id(id); @topic_id_by_post_id[post_id_from_imported_id(id)]; end+ def post_number_from_imported_id(id)+ @post_number_by_post_id[post_id_from_imported_id(id)]+ end+ def topic_id_from_imported_post_id(id)+ @topic_id_by_post_id[post_id_from_imported_id(id)]+ endGROUP_COLUMNS ||= %i{id name title bio_raw bio_cooked created_at updated_at@@ -250,7 +264,9 @@ class BulkImport::Basetopic_id tag_id created_at updated_at}- def create_groups(rows, &block); create_records(rows, "group", GROUP_COLUMNS, &block); end+ def create_groups(rows, &block)+ create_records(rows, "group", GROUP_COLUMNS, &block)+ enddef create_users(rows, &block)@imported_usernames = {}@@ -273,16 +289,36 @@ class BulkImport::Baseendend- def create_user_emails(rows, &block) create_records(rows, "user_email", USER_EMAIL_COLUMNS, &block); end- def create_user_stats(rows, &block) create_records(rows, "user_stat", USER_STAT_COLUMNS, &block); end- def create_user_profiles(rows, &block); create_records(rows, "user_profile", USER_PROFILE_COLUMNS, &block); end- def create_group_users(rows, &block); create_records(rows, "group_user", GROUP_USER_COLUMNS, &block); end- def create_categories(rows, &block); create_records(rows, "category", CATEGORY_COLUMNS, &block); end- def create_topics(rows, &block); create_records(rows, "topic", TOPIC_COLUMNS, &block); end- def create_posts(rows, &block); create_records(rows, "post", POST_COLUMNS, &block); end- def create_post_actions(rows, &block); create_records(rows, "post_action", POST_ACTION_COLUMNS, &block); end- def create_topic_allowed_users(rows, &block); create_records(rows, "topic_allowed_user", TOPIC_ALLOWED_USER_COLUMNS, &block); end- def create_topic_tags(rows, &block); create_records(rows, "topic_tag", TOPIC_TAG_COLUMNS, &block); end+ def create_user_emails(rows, &block)+ create_records(rows, "user_email", USER_EMAIL_COLUMNS, &block)+ end+ def create_user_stats(rows, &block)+ create_records(rows, "user_stat", USER_STAT_COLUMNS, &block)+ end+ def create_user_profiles(rows, &block)+ create_records(rows, "user_profile", USER_PROFILE_COLUMNS, &block)+ end+ def create_group_users(rows, &block)+ create_records(rows, "group_user", GROUP_USER_COLUMNS, &block)+ end+ def create_categories(rows, &block)+ create_records(rows, "category", CATEGORY_COLUMNS, &block)+ end+ def create_topics(rows, &block)+ create_records(rows, "topic", TOPIC_COLUMNS, &block)+ end+ def create_posts(rows, &block)+ create_records(rows, "post", POST_COLUMNS, &block)+ end+ def create_post_actions(rows, &block)+ create_records(rows, "post_action", POST_ACTION_COLUMNS, &block)+ end+ def create_topic_allowed_users(rows, &block)+ create_records(rows, "topic_allowed_user", TOPIC_ALLOWED_USER_COLUMNS, &block)+ end+ def create_topic_tags(rows, &block)+ create_records(rows, "topic_tag", TOPIC_TAG_COLUMNS, &block)+ enddef process_group(group)@groups[group[:imported_id].to_s] = group[:id] = @last_group_id += 1@@ -339,7 +375,7 @@ class BulkImport::Baseenddef process_user_email(user_email)- user_email[:id] = @last_user_email_id += 1;+ user_email[:id] = @last_user_email_id += 1user_email[:user_id] = @users[user_email[:imported_user_id].to_s]user_email[:primary] = trueuser_email[:created_at] ||= NOWdiff --git a/script/compile_hbs.rb b/script/compile_hbs.rbindex 785aae6b38e..21d2b22713e 100644--- a/script/compile_hbs.rb+++ b/script/compile_hbs.rb@@ -1,7 +1,7 @@ctx = MiniRacer::Context.new(timeout: 15000)ctx.eval("var self = this; #{File.read("#{Rails.root}/vendor/assets/javascripts/babel.js")}")ctx.eval(File.read(Ember::Source.bundled_path_for('ember-template-compiler.js')))-ctx.eval("module = {}; exports = {};");+ctx.eval("module = {}; exports = {};")ctx.attach("rails.logger.info", proc { |err| puts(">> #{err.to_s}") })ctx.attach("rails.logger.error", proc { |err| puts(">> #{err.to_s}") })ctx.eval <<JS@@ -20,5 +20,5 @@ ctx.eval(js)if ARGV[0].present?source = File.read(ARGV[0])js_source = ::JSON.generate(source, quirks_mode: true)- puts ctx.eval("exports.compile(#{js_source})");+ puts ctx.eval("exports.compile(#{js_source})")enddiff --git a/script/import_scripts/bespoke_1.rb b/script/import_scripts/bespoke_1.rbindex 0026ff30ace..0607a616000 100644--- a/script/import_scripts/bespoke_1.rb+++ b/script/import_scripts/bespoke_1.rb@@ -65,7 +65,7 @@ class ImportScripts::Bespoke < ImportScripts::Basefirst = truerow = nil- current_row = "";+ current_row = ""double_quote_count = 0File.open(filename).each_line do |line|diff --git a/script/import_scripts/drupal_qa.rb b/script/import_scripts/drupal_qa.rbindex 98d79198646..b7bad2fbf6a 100644--- a/script/import_scripts/drupal_qa.rb+++ b/script/import_scripts/drupal_qa.rb@@ -52,7 +52,7 @@ class ImportScripts::DrupalQA < ImportScripts::DrupalGROUP BY n.nid, n.title, n.uid, n.created, f.body_valueLIMIT #{batch_size}OFFSET #{offset}- ", cache_rows: false);+ ", cache_rows: false)break if results.size < 1diff --git a/script/import_scripts/jive.rb b/script/import_scripts/jive.rbindex ae077bda2ee..586e5443af8 100644--- a/script/import_scripts/jive.rb+++ b/script/import_scripts/jive.rb@@ -67,7 +67,7 @@ class ImportScripts::Jive < ImportScripts::Basefirst = truerow = nil- current_row = "";+ current_row = ""double_quote_count = 0File.open(filename).each_line do |line|diff --git a/script/import_scripts/lithium.rb b/script/import_scripts/lithium.rbindex 834f97cec28..2296d71a1fa 100644--- a/script/import_scripts/lithium.rb+++ b/script/import_scripts/lithium.rb@@ -1019,7 +1019,7 @@ SQLenddef html_for_attachments(user_id, files)- html = "";+ html = ""files.each do |file|upload, filename = find_upload(user_id, file["attachment_id"], file["file_name"])diff --git a/script/import_scripts/nabble.rb b/script/import_scripts/nabble.rbindex ac3a93f8dcf..8f371da4e80 100644--- a/script/import_scripts/nabble.rb+++ b/script/import_scripts/nabble.rb@@ -172,7 +172,7 @@ class ImportScripts::Nabble < ImportScripts::Basetxt.gsub! /\<quote author="(.*?)"\>/, '[quote="\1"]'txt.gsub! /\<\/quote\>/, '[/quote]'txt.gsub!(/\<raw\>(.*?)\<\/raw\>/m) do |match|- c = Regexp.last_match[1].indent(4);+ c = Regexp.last_match[1].indent(4)"\n#{c}\n"enddiff --git a/script/import_scripts/phpbb3/database/database.rb b/script/import_scripts/phpbb3/database/database.rbindex fa88352349f..3cc3bd9e439 100644--- a/script/import_scripts/phpbb3/database/database.rb+++ b/script/import_scripts/phpbb3/database/database.rb@@ -53,6 +53,6 @@ module ImportScripts::PhpBB3endend- class UnsupportedVersionError < RuntimeError;+ class UnsupportedVersionError < RuntimeErrorendenddiff --git a/script/test_hbs_compiler.rb b/script/test_hbs_compiler.rbindex 0045b942545..e5dec469ad4 100644--- a/script/test_hbs_compiler.rb+++ b/script/test_hbs_compiler.rb@@ -19,7 +19,7 @@ HBSctx = MiniRacer::Context.new(timeout: 15000)ctx.eval("var self = this; #{File.read("#{Rails.root}/vendor/assets/javascripts/babel.js")}")ctx.eval(File.read(Ember::Source.bundled_path_for('ember-template-compiler.js')))-ctx.eval("module = {}; exports = {};");+ctx.eval("module = {}; exports = {};")ctx.attach("rails.logger.info", proc { |err| puts(err.to_s) })ctx.attach("rails.logger.error", proc { |err| puts(err.to_s) })ctx.eval <<JS@@ -35,4 +35,4 @@ ctx.eval(source)js_source = ::JSON.generate(template, quirks_mode: true)-puts ctx.eval("exports.compile(#{js_source})");+puts ctx.eval("exports.compile(#{js_source})")diff --git a/spec/components/auth/managed_authenticator_spec.rb b/spec/components/auth/managed_authenticator_spec.rbindex 300a4cc0f52..da02c870521 100644--- a/spec/components/auth/managed_authenticator_spec.rb+++ b/spec/components/auth/managed_authenticator_spec.rb@@ -3,7 +3,9 @@ require 'rails_helper'describe Auth::ManagedAuthenticator dolet(:authenticator) {Class.new(described_class) do- def name; "myauth" end+ def name+ "myauth"+ endend.new}@@ -55,8 +57,12 @@ describe Auth::ManagedAuthenticator doit 'does not work when disabled' doauthenticator = Class.new(described_class) do- def name; "myauth" end- def can_connect_existing_user?; false end+ def name+ "myauth"+ end+ def can_connect_existing_user?+ false+ endend.newresult = authenticator.after_authenticate(hash, existing_account: user2)expect(result.user.id).to eq(user1.id)@@ -81,8 +87,12 @@ describe Auth::ManagedAuthenticator doit 'does not match if match_by_email is false' doauthenticator = Class.new(described_class) do- def name; "myauth" end- def match_by_email; false end+ def name+ "myauth"+ end+ def match_by_email+ false+ endend.newuser = Fabricate(:user, email: "[email protected]")result = authenticator.after_authenticate(hash)diff --git a/spec/components/guardian_spec.rb b/spec/components/guardian_spec.rbindex 9f9da726038..c05b994f7a9 100644--- a/spec/components/guardian_spec.rb+++ b/spec/components/guardian_spec.rb@@ -1,4 +1,4 @@-require 'rails_helper';+require 'rails_helper'require 'guardian'require_dependency 'post_destroyer'diff --git a/spec/components/plugin/instance_spec.rb b/spec/components/plugin/instance_spec.rbindex 2104f72dffa..48cdc6ac6eb 100644--- a/spec/components/plugin/instance_spec.rb+++ b/spec/components/plugin/instance_spec.rb@@ -36,7 +36,9 @@ describe Plugin::Instance doclass TroutPlugin < Plugin::Instanceattr_accessor :enabled- def enabled?; @enabled; end+ def enabled?+ @enabled+ endendbefore dodiff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rbindex 208b08d14fc..64ce1a3a402 100644--- a/spec/components/pretty_text_spec.rb+++ b/spec/components/pretty_text_spec.rb@@ -1118,13 +1118,13 @@ HTMLit "supports url bbcode" docooked = PrettyText.cook "[url]http://sam.com[/url]"- html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener">http://sam.com</a></p>';+ html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener">http://sam.com</a></p>'expect(cooked).to eq(html)endit "supports nesting tags in url" docooked = PrettyText.cook("[url=http://sam.com][b]I am sam[/b][/url]")- html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener"><span class="bbcode-b">I am sam</span></a></p>';+ html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener"><span class="bbcode-b">I am sam</span></a></p>'expect(cooked).to eq(html)enddiff --git a/spec/lib/content_security_policy_spec.rb b/spec/lib/content_security_policy_spec.rbindex ba625860f1e..40f618d2e37 100644--- a/spec/lib/content_security_policy_spec.rb+++ b/spec/lib/content_security_policy_spec.rb@@ -86,7 +86,9 @@ describe ContentSecurityPolicy doit 'can be extended by plugins' doplugin = Class.new(Plugin::Instance) doattr_accessor :enabled- def enabled?; @enabled; end+ def enabled?+ @enabled+ endend.new(nil, "#{Rails.root}/spec/fixtures/plugins/csp_extension/plugin.rb")plugin.activate!diff --git a/spec/models/topic_user_spec.rb b/spec/models/topic_user_spec.rbindex aa333172cfe..fca57e78047 100644--- a/spec/models/topic_user_spec.rb+++ b/spec/models/topic_user_spec.rb@@ -240,7 +240,7 @@ describe TopicUser docreate_post(archetype: Archetype.private_message,target_usernames: target_user.username- );+ )endlet(:topic) { post.topic }diff --git a/spec/requests/categories_controller_spec.rb b/spec/requests/categories_controller_spec.rbindex 871c3d02b6a..ec9b28123a7 100644--- a/spec/requests/categories_controller_spec.rb+++ b/spec/requests/categories_controller_spec.rb@@ -184,7 +184,7 @@ describe CategoriesController doc3 = Fabricate(:category)c4 = Fabricate(:category)if c3.id < c2.id- tmp = c3; c2 = c3; c3 = tmp;+ tmp = c3; c2 = c3; c3 = tmpendc1.position = 8c2.position = 6diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rbindex 84b232b986f..137649c3d8c 100644--- a/spec/requests/users_controller_spec.rb+++ b/spec/requests/users_controller_spec.rb@@ -470,7 +470,7 @@ describe UsersController doget "/u/admin-login/#{email_token.token}"expect(response).not_to redirect_to('/')expect(session[:current_user_id]).not_to eq(admin.id)- expect(response.body).to include(I18n.t('login.second_factor_description'));+ expect(response.body).to include(I18n.t('login.second_factor_description'))enddescribe 'invalid 2 factor token' do@@ -483,8 +483,8 @@ describe UsersController do}expect(response.status).to eq(200)- expect(response.body).to include(I18n.t('login.second_factor_description'));- expect(response.body).to include(I18n.t('login.invalid_second_factor_code'));+ expect(response.body).to include(I18n.t('login.second_factor_description'))+ expect(response.body).to include(I18n.t('login.invalid_second_factor_code'))endend