Browse Source

Restore missing fabricators (#23951)

closed-social-glitch-2
Matt Jankowski 1 year ago
committed by GitHub
parent
commit
2d1ccb3d8b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 0 deletions
  1. +5
    -0
      spec/fabricators/account_warning_preset_fabricator.rb
  2. +7
    -0
      spec/fabricators/list_account_fabricator.rb
  3. +13
    -0
      spec/fabricators/one_time_key_fabricator.rb

+ 5
- 0
spec/fabricators/account_warning_preset_fabricator.rb View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
Fabricator(:account_warning_preset) do
text { Faker::Lorem.paragraph }
end

+ 7
- 0
spec/fabricators/list_account_fabricator.rb View 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
- 0
spec/fabricators/one_time_key_fabricator.rb View 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…
Cancel
Save