Autofix Rubocop RSpec/ExampleWording (#23667)
This commit is contained in:
parent
7a3d4c3d4b
commit
c0a645f647
4 changed files with 10 additions and 20 deletions
|
@ -907,16 +907,6 @@ RSpec/EmptyLineAfterSubject:
|
||||||
RSpec/ExampleLength:
|
RSpec/ExampleLength:
|
||||||
Max: 22
|
Max: 22
|
||||||
|
|
||||||
# Offense count: 10
|
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
|
||||||
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
|
|
||||||
# DisallowedExamples: works
|
|
||||||
RSpec/ExampleWording:
|
|
||||||
Exclude:
|
|
||||||
- 'spec/controllers/settings/applications_controller_spec.rb'
|
|
||||||
- 'spec/models/custom_emoji_spec.rb'
|
|
||||||
- 'spec/models/user_spec.rb'
|
|
||||||
|
|
||||||
# Offense count: 2
|
# Offense count: 2
|
||||||
# This cop supports safe autocorrection (--autocorrect).
|
# This cop supports safe autocorrection (--autocorrect).
|
||||||
RSpec/ExcessiveDocstringSpacing:
|
RSpec/ExcessiveDocstringSpacing:
|
||||||
|
|
|
@ -37,7 +37,7 @@ describe Settings::ApplicationsController do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #new' do
|
describe 'GET #new' do
|
||||||
it 'works' do
|
it 'returns http success' do
|
||||||
get :new
|
get :new
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
|
@ -180,7 +180,7 @@ describe Settings::ApplicationsController do
|
||||||
post :regenerate, params: { id: app.id }
|
post :regenerate, params: { id: app.id }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should create new token' do
|
it 'creates new token' do
|
||||||
expect(user.token_for_app(app)).to_not eql(token)
|
expect(user.token_for_app(app)).to_not eql(token)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -79,7 +79,7 @@ RSpec.describe CustomEmoji, type: :model do
|
||||||
describe 'pre_validation' do
|
describe 'pre_validation' do
|
||||||
let(:custom_emoji) { Fabricate(:custom_emoji, domain: 'wWw.MaStOdOn.CoM') }
|
let(:custom_emoji) { Fabricate(:custom_emoji, domain: 'wWw.MaStOdOn.CoM') }
|
||||||
|
|
||||||
it 'should downcase' do
|
it 'downcases' do
|
||||||
custom_emoji.valid?
|
custom_emoji.valid?
|
||||||
expect(custom_emoji.domain).to eq('www.mastodon.com')
|
expect(custom_emoji.domain).to eq('www.mastodon.com')
|
||||||
end
|
end
|
||||||
|
|
|
@ -110,19 +110,19 @@ RSpec.describe User, type: :model do
|
||||||
Rails.configuration.x.email_domains_blacklist = old_blacklist
|
Rails.configuration.x.email_domains_blacklist = old_blacklist
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should allow a non-blacklisted user to be created' do
|
it 'allows a non-blacklisted user to be created' do
|
||||||
user = User.new(email: 'foo@example.com', account: account, password: password, agreement: true)
|
user = User.new(email: 'foo@example.com', account: account, password: password, agreement: true)
|
||||||
|
|
||||||
expect(user.valid?).to be_truthy
|
expect(user.valid?).to be_truthy
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not allow a blacklisted user to be created' do
|
it 'does not allow a blacklisted user to be created' do
|
||||||
user = User.new(email: 'foo@mvrht.com', account: account, password: password, agreement: true)
|
user = User.new(email: 'foo@mvrht.com', account: account, password: password, agreement: true)
|
||||||
|
|
||||||
expect(user.valid?).to be_falsey
|
expect(user.valid?).to be_falsey
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not allow a subdomain blacklisted user to be created' do
|
it 'does not allow a subdomain blacklisted user to be created' do
|
||||||
user = User.new(email: 'foo@mvrht.com.topdomain.tld', account: account, password: password, agreement: true)
|
user = User.new(email: 'foo@mvrht.com.topdomain.tld', account: account, password: password, agreement: true)
|
||||||
|
|
||||||
expect(user.valid?).to be_falsey
|
expect(user.valid?).to be_falsey
|
||||||
|
@ -346,17 +346,17 @@ RSpec.describe User, type: :model do
|
||||||
Rails.configuration.x.email_domains_whitelist = old_whitelist
|
Rails.configuration.x.email_domains_whitelist = old_whitelist
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not allow a user to be created unless they are whitelisted' do
|
it 'does not allow a user to be created unless they are whitelisted' do
|
||||||
user = User.new(email: 'foo@example.com', account: account, password: password, agreement: true)
|
user = User.new(email: 'foo@example.com', account: account, password: password, agreement: true)
|
||||||
expect(user.valid?).to be_falsey
|
expect(user.valid?).to be_falsey
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should allow a user to be created if they are whitelisted' do
|
it 'allows a user to be created if they are whitelisted' do
|
||||||
user = User.new(email: 'foo@mastodon.space', account: account, password: password, agreement: true)
|
user = User.new(email: 'foo@mastodon.space', account: account, password: password, agreement: true)
|
||||||
expect(user.valid?).to be_truthy
|
expect(user.valid?).to be_truthy
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not allow a user with a whitelisted top domain as subdomain in their email address to be created' do
|
it 'does not allow a user with a whitelisted top domain as subdomain in their email address to be created' do
|
||||||
user = User.new(email: 'foo@mastodon.space.userdomain.com', account: account, password: password, agreement: true)
|
user = User.new(email: 'foo@mastodon.space.userdomain.com', account: account, password: password, agreement: true)
|
||||||
expect(user.valid?).to be_falsey
|
expect(user.valid?).to be_falsey
|
||||||
end
|
end
|
||||||
|
@ -368,7 +368,7 @@ RSpec.describe User, type: :model do
|
||||||
Rails.configuration.x.email_domains_blacklist = old_blacklist
|
Rails.configuration.x.email_domains_blacklist = old_blacklist
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not allow a user to be created with a specific blacklisted subdomain even if the top domain is whitelisted' do
|
it 'does not allow a user to be created with a specific blacklisted subdomain even if the top domain is whitelisted' do
|
||||||
Rails.configuration.x.email_domains_blacklist = 'blacklisted.mastodon.space'
|
Rails.configuration.x.email_domains_blacklist = 'blacklisted.mastodon.space'
|
||||||
|
|
||||||
user = User.new(email: 'foo@blacklisted.mastodon.space', account: account, password: password)
|
user = User.new(email: 'foo@blacklisted.mastodon.space', account: account, password: password)
|
||||||
|
|
Loading…
Reference in a new issue