1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-27 14:29:03 +09:00

Bump faker from 1.9.6 to 2.1.0 and update faker api (#11489)

* Bump faker from 1.9.6 to 2.1.0

Bumps [faker](https://github.com/stympy/faker) from 1.9.6 to 2.1.0.
- [Release notes](https://github.com/stympy/faker/releases)
- [Changelog](https://github.com/stympy/faker/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stympy/faker/compare/1.9.6...v2.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Use faker api v2

https://github.com/stympy/faker/releases/tag/2.0
This commit is contained in:
Yusuke Nakamura 2019-08-06 22:33:03 +09:00 committed by Eugen Rochko
parent 1d8d553d8b
commit 82d2069c75
7 changed files with 17 additions and 17 deletions

View File

@ -112,7 +112,7 @@ end
group :test do group :test do
gem 'capybara', '~> 3.28' gem 'capybara', '~> 3.28'
gem 'climate_control', '~> 0.2' gem 'climate_control', '~> 0.2'
gem 'faker', '~> 1.9' gem 'faker', '~> 2.1'
gem 'microformats', '~> 4.1' gem 'microformats', '~> 4.1'
gem 'rails-controller-testing', '~> 1.0' gem 'rails-controller-testing', '~> 1.0'
gem 'rspec-sidekiq', '~> 3.0' gem 'rspec-sidekiq', '~> 3.0'

View File

@ -229,7 +229,7 @@ GEM
tzinfo tzinfo
excon (0.62.0) excon (0.62.0)
fabrication (2.20.2) fabrication (2.20.2)
faker (1.9.6) faker (2.1.0)
i18n (>= 0.7) i18n (>= 0.7)
faraday (0.15.0) faraday (0.15.0)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
@ -695,7 +695,7 @@ DEPENDENCIES
doorkeeper (~> 5.1) doorkeeper (~> 5.1)
dotenv-rails (~> 2.7) dotenv-rails (~> 2.7)
fabrication (~> 2.20) fabrication (~> 2.20)
faker (~> 1.9) faker (~> 2.1)
fast_blank (~> 1.0) fast_blank (~> 1.0)
fastimage fastimage
fog-core (<= 2.1.0) fog-core (<= 2.1.0)

View File

@ -8,8 +8,8 @@ describe Settings::IdentityProofsController do
let(:valid_token) { '1'*66 } let(:valid_token) { '1'*66 }
let(:kbname) { 'kbuser' } let(:kbname) { 'kbuser' }
let(:provider) { 'keybase' } let(:provider) { 'keybase' }
let(:findable_id) { Faker::Number.number(5) } let(:findable_id) { Faker::Number.number(digits: 5) }
let(:unfindable_id) { Faker::Number.number(5) } let(:unfindable_id) { Faker::Number.number(digits: 5) }
let(:new_proof_params) do let(:new_proof_params) do
{ provider: provider, provider_username: kbname, token: valid_token, username: user.account.username } { provider: provider, provider_username: kbname, token: valid_token, username: user.account.username }
end end

View File

@ -4,7 +4,7 @@ private_key = keypair.to_pem
Fabricator(:account) do Fabricator(:account) do
transient :suspended, :silenced transient :suspended, :silenced
username { sequence(:username) { |i| "#{Faker::Internet.user_name(nil, %w(_))}#{i}" } } username { sequence(:username) { |i| "#{Faker::Internet.user_name(separators: %w(_))}#{i}" } }
last_webfingered_at { Time.now.utc } last_webfingered_at { Time.now.utc }
public_key { public_key } public_key { public_key }
private_key { private_key } private_key { private_key }

View File

@ -1,7 +1,7 @@
Fabricator(:account_identity_proof) do Fabricator(:account_identity_proof) do
account account
provider 'keybase' provider 'keybase'
provider_username { sequence(:provider_username) { |i| "#{Faker::Lorem.characters(15)}" } } provider_username { sequence(:provider_username) { |i| "#{Faker::Lorem.characters(number: 15)}" } }
token { sequence(:token) { |i| "#{i}#{Faker::Crypto.sha1()*2}"[0..65] } } token { sequence(:token) { |i| "#{i}#{Faker::Crypto.sha1()*2}"[0..65] } }
verified false verified false
live false live false

View File

@ -607,19 +607,19 @@ RSpec.describe Account, type: :model do
end end
it 'is invalid if the username is longer then 30 characters' do it 'is invalid if the username is longer then 30 characters' do
account = Fabricate.build(:account, username: Faker::Lorem.characters(31)) account = Fabricate.build(:account, username: Faker::Lorem.characters(number: 31))
account.valid? account.valid?
expect(account).to model_have_error_on_field(:username) expect(account).to model_have_error_on_field(:username)
end end
it 'is invalid if the display name is longer than 30 characters' do it 'is invalid if the display name is longer than 30 characters' do
account = Fabricate.build(:account, display_name: Faker::Lorem.characters(31)) account = Fabricate.build(:account, display_name: Faker::Lorem.characters(number: 31))
account.valid? account.valid?
expect(account).to model_have_error_on_field(:display_name) expect(account).to model_have_error_on_field(:display_name)
end end
it 'is invalid if the note is longer than 500 characters' do it 'is invalid if the note is longer than 500 characters' do
account = Fabricate.build(:account, note: Faker::Lorem.characters(501)) account = Fabricate.build(:account, note: Faker::Lorem.characters(number: 501))
account.valid? account.valid?
expect(account).to model_have_error_on_field(:note) expect(account).to model_have_error_on_field(:note)
end end
@ -653,19 +653,19 @@ RSpec.describe Account, type: :model do
end end
it 'is valid even if the username is longer then 30 characters' do it 'is valid even if the username is longer then 30 characters' do
account = Fabricate.build(:account, domain: 'domain', username: Faker::Lorem.characters(31)) account = Fabricate.build(:account, domain: 'domain', username: Faker::Lorem.characters(number: 31))
account.valid? account.valid?
expect(account).not_to model_have_error_on_field(:username) expect(account).not_to model_have_error_on_field(:username)
end end
it 'is valid even if the display name is longer than 30 characters' do it 'is valid even if the display name is longer than 30 characters' do
account = Fabricate.build(:account, domain: 'domain', display_name: Faker::Lorem.characters(31)) account = Fabricate.build(:account, domain: 'domain', display_name: Faker::Lorem.characters(number: 31))
account.valid? account.valid?
expect(account).not_to model_have_error_on_field(:display_name) expect(account).not_to model_have_error_on_field(:display_name)
end end
it 'is valid even if the note is longer than 500 characters' do it 'is valid even if the note is longer than 500 characters' do
account = Fabricate.build(:account, domain: 'domain', note: Faker::Lorem.characters(501)) account = Fabricate.build(:account, domain: 'domain', note: Faker::Lorem.characters(number: 501))
account.valid? account.valid?
expect(account).not_to model_have_error_on_field(:note) expect(account).not_to model_have_error_on_field(:note)
end end
@ -804,7 +804,7 @@ RSpec.describe Account, type: :model do
context 'when is local' do context 'when is local' do
# Test disabled because test environment omits autogenerating keys for performance # Test disabled because test environment omits autogenerating keys for performance
xit 'generates keys' do xit 'generates keys' do
account = Account.create!(domain: nil, username: Faker::Internet.user_name(nil, ['_'])) account = Account.create!(domain: nil, username: Faker::Internet.user_name(separators: ['_']))
expect(account.keypair.private?).to eq true expect(account.keypair.private?).to eq true
end end
end end
@ -812,12 +812,12 @@ RSpec.describe Account, type: :model do
context 'when is remote' do context 'when is remote' do
it 'does not generate keys' do it 'does not generate keys' do
key = OpenSSL::PKey::RSA.new(1024).public_key key = OpenSSL::PKey::RSA.new(1024).public_key
account = Account.create!(domain: 'remote', username: Faker::Internet.user_name(nil, ['_']), public_key: key.to_pem) account = Account.create!(domain: 'remote', username: Faker::Internet.user_name(separators: ['_']), public_key: key.to_pem)
expect(account.keypair.params).to eq key.params expect(account.keypair.params).to eq key.params
end end
it 'normalizes domain' do it 'normalizes domain' do
account = Account.create!(domain: 'にゃん', username: Faker::Internet.user_name(nil, ['_'])) account = Account.create!(domain: 'にゃん', username: Faker::Internet.user_name(separators: ['_']))
expect(account.domain).to eq 'xn--r9j5b5b' expect(account.domain).to eq 'xn--r9j5b5b'
end end
end end

View File

@ -125,7 +125,7 @@ describe Report do
end end
it 'is invalid if comment is longer than 1000 characters' do it 'is invalid if comment is longer than 1000 characters' do
report = Fabricate.build(:report, comment: Faker::Lorem.characters(1001)) report = Fabricate.build(:report, comment: Faker::Lorem.characters(number: 1001))
report.valid? report.valid?
expect(report).to model_have_error_on_field(:comment) expect(report).to model_have_error_on_field(:comment)
end end