From cd99fa8cebc6efa059b4fca743d517c88f8d9686 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Sat, 4 Mar 2023 11:12:09 -0500 Subject: Fabricator specs (#23925) --- spec/fabricators/list_account_fabricator.rb | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 spec/fabricators/list_account_fabricator.rb (limited to 'spec/fabricators/list_account_fabricator.rb') diff --git a/spec/fabricators/list_account_fabricator.rb b/spec/fabricators/list_account_fabricator.rb deleted file mode 100644 index b0af29e6f..000000000 --- a/spec/fabricators/list_account_fabricator.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -Fabricator(:list_account) do - list nil - account nil - follow nil -end -- cgit From 2d1ccb3d8b9427cdc8ec1e187980458ab8a0890f Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Sat, 4 Mar 2023 12:31:13 -0500 Subject: Restore missing fabricators (#23951) --- spec/fabricators/account_warning_preset_fabricator.rb | 5 +++++ spec/fabricators/list_account_fabricator.rb | 7 +++++++ spec/fabricators/one_time_key_fabricator.rb | 13 +++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 spec/fabricators/account_warning_preset_fabricator.rb create mode 100644 spec/fabricators/list_account_fabricator.rb create mode 100644 spec/fabricators/one_time_key_fabricator.rb (limited to 'spec/fabricators/list_account_fabricator.rb') diff --git a/spec/fabricators/account_warning_preset_fabricator.rb b/spec/fabricators/account_warning_preset_fabricator.rb new file mode 100644 index 000000000..c50e08bf4 --- /dev/null +++ b/spec/fabricators/account_warning_preset_fabricator.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Fabricator(:account_warning_preset) do + text { Faker::Lorem.paragraph } +end diff --git a/spec/fabricators/list_account_fabricator.rb b/spec/fabricators/list_account_fabricator.rb new file mode 100644 index 000000000..00dde83cd --- /dev/null +++ b/spec/fabricators/list_account_fabricator.rb @@ -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 diff --git a/spec/fabricators/one_time_key_fabricator.rb b/spec/fabricators/one_time_key_fabricator.rb new file mode 100644 index 000000000..cfb365cab --- /dev/null +++ b/spec/fabricators/one_time_key_fabricator.rb @@ -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 -- cgit