Skip to content

Commit

Permalink
Restore missing fabricators (mastodon#23951)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski authored and arachnist committed Apr 4, 2023
1 parent 1e578eb commit 4ff21cc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/fabricators/account_warning_preset_fabricator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Fabricator(:account_warning_preset) do
text { Faker::Lorem.paragraph }
end
7 changes: 7 additions & 0 deletions spec/fabricators/list_account_fabricator.rb
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions spec/fabricators/one_time_key_fabricator.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4ff21cc

Please sign in to comment.