mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-19 05:13:01 +00:00
Restore missing fabricators (#23951)
This commit is contained in:
parent
506b16cf59
commit
2d1ccb3d8b
5
spec/fabricators/account_warning_preset_fabricator.rb
Normal file
5
spec/fabricators/account_warning_preset_fabricator.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
Fabricator(:account_warning_preset) do
|
||||||
|
text { Faker::Lorem.paragraph }
|
||||||
|
end
|
7
spec/fabricators/list_account_fabricator.rb
Normal file
7
spec/fabricators/list_account_fabricator.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
Fabricator(:list_account) do
|
||||||
|
list
|
||||||
|
account
|
||||||
|
before_create { |list_account, _| list_account.list.account.follow!(account) }
|
||||||
|
end
|
13
spec/fabricators/one_time_key_fabricator.rb
Normal file
13
spec/fabricators/one_time_key_fabricator.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
Fabricator(:one_time_key) do
|
||||||
|
device
|
||||||
|
key_id { Faker::Alphanumeric.alphanumeric(number: 10) }
|
||||||
|
key { Base64.strict_encode64(Ed25519::SigningKey.generate.verify_key.to_bytes) }
|
||||||
|
|
||||||
|
signature do |attrs|
|
||||||
|
signing_key = Ed25519::SigningKey.generate
|
||||||
|
attrs[:device].update(fingerprint_key: Base64.strict_encode64(signing_key.verify_key.to_bytes))
|
||||||
|
Base64.strict_encode64(signing_key.sign(attrs[:key]))
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue