DEV: use #frozen_string_literal: true on all spec

This change both speeds up specs (less strings to allocate) and helps catch
cases where methods in Discourse are mutating inputs.

Overall we will be migrating everything to use #frozen_string_literal: true
it will take a while, but this is the first and safest move in this direction
This commit is contained in:
Sam Saffron
2019-04-30 10:27:42 +10:00
parent 0a5a6dfded
commit 4ea21fa2d0
658 changed files with 1306 additions and 13 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe AllowedIpAddressValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
require 'validators/category_search_priority_weights_validator'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe EmailSettingValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe EmailValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe EnableInviteOnlyValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe EnableLocalLoginsViaEmailValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe EnableSsoValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe ExternalSystemAvatarsValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe GroupSettingValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe IntegerSettingValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe IpAddressFormatValidator do

View File

@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
require 'rails_helper'
require 'validators/max_emojis_validator'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe MaxUsernameLengthValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe MinUsernameLengthValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
require_dependency "common_passwords/common_passwords"

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
require_dependency 'validators/post_validator'

View File

@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
require 'rails_helper'
require 'validators/quality_title_validator'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
RSpec.describe RegexPresenceValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe RegexSettingValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe ReplyByEmailAddressValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe ReplyByEmailEnabledValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe SsoOverridesEmailValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe StringSettingValidator do

View File

@ -1,4 +1,5 @@
# encoding: UTF-8
# frozen_string_literal: true
require 'rails_helper'
require 'validators/topic_title_length_validator'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe UnicodeUsernameValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe UnicodeUsernameWhitelistValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
require_dependency 'validators/upload_validator'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
require 'validators/topic_title_length_validator'

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require "rails_helper"
describe UserFullNameValidator do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe UsernameSettingValidator do