mirror of https://github.com/mastodon/mastodon
Merge f98c0a016e
into 1959365c2f
This commit is contained in:
commit
89f0881b7c
|
@ -1,6 +1,6 @@
|
|||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
|
||||
# using RuboCop version 1.62.1.
|
||||
# using RuboCop version 1.63.3.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
|
@ -127,7 +127,6 @@ Style/IfUnlessModifier:
|
|||
Exclude:
|
||||
- 'config/environments/production.rb'
|
||||
- 'config/initializers/devise.rb'
|
||||
- 'config/initializers/ffmpeg.rb'
|
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Style/MapToHash:
|
||||
|
@ -198,10 +197,3 @@ Style/SafeNavigation:
|
|||
Style/StringConcatenation:
|
||||
Exclude:
|
||||
- 'config/initializers/paperclip.rb'
|
||||
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: WordRegex.
|
||||
# SupportedStyles: percent, brackets
|
||||
Style/WordArray:
|
||||
EnforcedStyle: percent
|
||||
MinSize: 3
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module LanguagesHelper
|
||||
# rubocop:disable Style/WordArray
|
||||
ISO_639_1 = {
|
||||
aa: ['Afar', 'Afaraf'].freeze,
|
||||
ab: ['Abkhaz', 'аҧсуа бызшәа'].freeze,
|
||||
|
@ -221,6 +222,8 @@ module LanguagesHelper
|
|||
'zh-YUE': ['Cantonese', '廣東話'].freeze,
|
||||
}.freeze
|
||||
|
||||
# rubocop:enable Style/WordArray
|
||||
|
||||
SUPPORTED_LOCALES = {}.merge(ISO_639_1).merge(ISO_639_1_REGIONAL).merge(ISO_639_3).freeze
|
||||
|
||||
# For ISO-639-1 and ISO-639-3 language codes, we have their official
|
||||
|
|
|
@ -90,7 +90,7 @@ RSpec.describe User do
|
|||
it 'preserves valid options for languages' do
|
||||
user = Fabricate.build(:user, chosen_languages: ['en', 'fr', ''])
|
||||
|
||||
expect(user.chosen_languages).to eq(['en', 'fr'])
|
||||
expect(user.chosen_languages).to eq(%w(en fr))
|
||||
end
|
||||
|
||||
it 'cleans out empty string from languages' do
|
||||
|
|
|
@ -62,7 +62,7 @@ describe 'API V1 Accounts Statuses' do
|
|||
.to contain_exactly(
|
||||
have_attributes(
|
||||
href: /pinned=true/,
|
||||
attr_pairs: contain_exactly(['rel', 'prev'])
|
||||
attr_pairs: contain_exactly(%w(rel prev))
|
||||
)
|
||||
)
|
||||
end
|
||||
|
@ -84,11 +84,11 @@ describe 'API V1 Accounts Statuses' do
|
|||
.to contain_exactly(
|
||||
have_attributes(
|
||||
href: /pinned=true/,
|
||||
attr_pairs: contain_exactly(['rel', 'next'])
|
||||
attr_pairs: contain_exactly(%w(rel next))
|
||||
),
|
||||
have_attributes(
|
||||
href: /pinned=true/,
|
||||
attr_pairs: contain_exactly(['rel', 'prev'])
|
||||
attr_pairs: contain_exactly(%w(rel prev))
|
||||
)
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue