Autofix Rubocop RSpec/BeEq (#23740)
This commit is contained in:
parent
bf785df9fe
commit
5116347eb7
39 changed files with 139 additions and 182 deletions
|
@ -7,7 +7,7 @@ RSpec.describe AccountDomainBlock, type: :model do
|
|||
|
||||
AccountDomainBlock.create!(account: account, domain: 'a.domain.blocked.later')
|
||||
|
||||
expect(Rails.cache.exist?("exclude_domains_for:#{account.id}")).to eq false
|
||||
expect(Rails.cache.exist?("exclude_domains_for:#{account.id}")).to be false
|
||||
end
|
||||
|
||||
it 'removes blocking cache after destruction' do
|
||||
|
@ -17,6 +17,6 @@ RSpec.describe AccountDomainBlock, type: :model do
|
|||
|
||||
block.destroy!
|
||||
|
||||
expect(Rails.cache.exist?("exclude_domains_for:#{account.id}")).to eq false
|
||||
expect(Rails.cache.exist?("exclude_domains_for:#{account.id}")).to be false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -160,7 +160,7 @@ RSpec.describe Account, type: :model do
|
|||
it 'sets default avatar, header, avatar_remote_url, and header_remote_url' do
|
||||
expect(account.avatar_remote_url).to eq 'https://remote.test/invalid_avatar'
|
||||
expect(account.header_remote_url).to eq expectation.header_remote_url
|
||||
expect(account.avatar_file_name).to eq nil
|
||||
expect(account.avatar_file_name).to be_nil
|
||||
expect(account.header_file_name).to eq expectation.header_file_name
|
||||
end
|
||||
end
|
||||
|
@ -259,11 +259,11 @@ RSpec.describe Account, type: :model do
|
|||
it 'is true when this account has favourited it' do
|
||||
Fabricate(:favourite, status: original_reblog, account: subject)
|
||||
|
||||
expect(subject.favourited?(original_status)).to eq true
|
||||
expect(subject.favourited?(original_status)).to be true
|
||||
end
|
||||
|
||||
it 'is false when this account has not favourited it' do
|
||||
expect(subject.favourited?(original_status)).to eq false
|
||||
expect(subject.favourited?(original_status)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -271,11 +271,11 @@ RSpec.describe Account, type: :model do
|
|||
it 'is true when this account has favourited it' do
|
||||
Fabricate(:favourite, status: original_status, account: subject)
|
||||
|
||||
expect(subject.favourited?(original_status)).to eq true
|
||||
expect(subject.favourited?(original_status)).to be true
|
||||
end
|
||||
|
||||
it 'is false when this account has not favourited it' do
|
||||
expect(subject.favourited?(original_status)).to eq false
|
||||
expect(subject.favourited?(original_status)).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -297,11 +297,11 @@ RSpec.describe Account, type: :model do
|
|||
it 'is true when this account has reblogged it' do
|
||||
Fabricate(:status, reblog: original_reblog, account: subject)
|
||||
|
||||
expect(subject.reblogged?(original_reblog)).to eq true
|
||||
expect(subject.reblogged?(original_reblog)).to be true
|
||||
end
|
||||
|
||||
it 'is false when this account has not reblogged it' do
|
||||
expect(subject.reblogged?(original_reblog)).to eq false
|
||||
expect(subject.reblogged?(original_reblog)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -309,11 +309,11 @@ RSpec.describe Account, type: :model do
|
|||
it 'is true when this account has reblogged it' do
|
||||
Fabricate(:status, reblog: original_status, account: subject)
|
||||
|
||||
expect(subject.reblogged?(original_status)).to eq true
|
||||
expect(subject.reblogged?(original_status)).to be true
|
||||
end
|
||||
|
||||
it 'is false when this account has not reblogged it' do
|
||||
expect(subject.reblogged?(original_status)).to eq false
|
||||
expect(subject.reblogged?(original_status)).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -958,7 +958,7 @@ RSpec.describe Account, type: :model do
|
|||
# Test disabled because test environment omits autogenerating keys for performance
|
||||
xit 'generates keys' do
|
||||
account = Account.create!(domain: nil, username: Faker::Internet.user_name(separators: ['_']))
|
||||
expect(account.keypair.private?).to eq true
|
||||
expect(account.keypair.private?).to be true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ RSpec.describe Block, type: :model do
|
|||
|
||||
Block.create!(account: account, target_account: target_account)
|
||||
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{account.id}")).to eq false
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{target_account.id}")).to eq false
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{account.id}")).to be false
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{target_account.id}")).to be false
|
||||
end
|
||||
|
||||
it 'removes blocking cache after destruction' do
|
||||
|
@ -41,7 +41,7 @@ RSpec.describe Block, type: :model do
|
|||
|
||||
block.destroy!
|
||||
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{account.id}")).to eq false
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{target_account.id}")).to eq false
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{account.id}")).to be false
|
||||
expect(Rails.cache.exist?("exclude_account_ids_for:#{target_account.id}")).to be false
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,16 +24,16 @@ RSpec.describe DomainBlock, type: :model do
|
|||
describe '.blocked?' do
|
||||
it 'returns true if the domain is suspended' do
|
||||
Fabricate(:domain_block, domain: 'example.com', severity: :suspend)
|
||||
expect(DomainBlock.blocked?('example.com')).to eq true
|
||||
expect(DomainBlock.blocked?('example.com')).to be true
|
||||
end
|
||||
|
||||
it 'returns false even if the domain is silenced' do
|
||||
Fabricate(:domain_block, domain: 'example.com', severity: :silence)
|
||||
expect(DomainBlock.blocked?('example.com')).to eq false
|
||||
expect(DomainBlock.blocked?('example.com')).to be false
|
||||
end
|
||||
|
||||
it 'returns false if the domain is not suspended nor silenced' do
|
||||
expect(DomainBlock.blocked?('example.com')).to eq false
|
||||
expect(DomainBlock.blocked?('example.com')).to be false
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ RSpec.describe Favourite, type: :model do
|
|||
|
||||
it 'invalidates if the reblogged status is already a favourite' do
|
||||
Favourite.create!(account: account, status: reblog)
|
||||
expect(Favourite.new(account: account, status: status).valid?).to eq false
|
||||
expect(Favourite.new(account: account, status: status).valid?).to be false
|
||||
end
|
||||
|
||||
it 'replaces status with the reblogged one if it is a reblog' do
|
||||
|
|
|
@ -138,7 +138,7 @@ RSpec.describe MediaAttachment, type: :model do
|
|||
end
|
||||
|
||||
it 'extracts thumbnail' do
|
||||
expect(media.thumbnail.present?).to eq true
|
||||
expect(media.thumbnail.present?).to be true
|
||||
end
|
||||
|
||||
it 'extracts colors from thumbnail' do
|
||||
|
|
|
@ -46,7 +46,7 @@ RSpec.describe User, type: :model do
|
|||
it 'cleans out empty string from languages' do
|
||||
user = Fabricate.build(:user, chosen_languages: [''])
|
||||
user.valid?
|
||||
expect(user.chosen_languages).to eq nil
|
||||
expect(user.chosen_languages).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ RSpec.describe Web::PushSubscription, type: :model do
|
|||
let(:policy) { 'all' }
|
||||
|
||||
it 'returns true' do
|
||||
expect(subject.pushable?(notification)).to eq true
|
||||
expect(subject.pushable?(notification)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -47,7 +47,7 @@ RSpec.describe Web::PushSubscription, type: :model do
|
|||
let(:policy) { 'none' }
|
||||
|
||||
it 'returns false' do
|
||||
expect(subject.pushable?(notification)).to eq false
|
||||
expect(subject.pushable?(notification)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -60,13 +60,13 @@ RSpec.describe Web::PushSubscription, type: :model do
|
|||
end
|
||||
|
||||
it 'returns true' do
|
||||
expect(subject.pushable?(notification)).to eq true
|
||||
expect(subject.pushable?(notification)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
context 'and notification is not from someone you follow' do
|
||||
it 'returns false' do
|
||||
expect(subject.pushable?(notification)).to eq false
|
||||
expect(subject.pushable?(notification)).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -80,13 +80,13 @@ RSpec.describe Web::PushSubscription, type: :model do
|
|||
end
|
||||
|
||||
it 'returns true' do
|
||||
expect(subject.pushable?(notification)).to eq true
|
||||
expect(subject.pushable?(notification)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
context 'and notification is not from someone who follows you' do
|
||||
it 'returns false' do
|
||||
expect(subject.pushable?(notification)).to eq false
|
||||
expect(subject.pushable?(notification)).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue