Gab Social. All are welcome.
This commit is contained in:
2
spec/fabricators/access_token_fabricator.rb
Normal file
2
spec/fabricators/access_token_fabricator.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
Fabricator :access_token, from: 'Doorkeeper::AccessToken' do
|
||||
end
|
||||
4
spec/fabricators/accessible_access_token_fabricator.rb
Normal file
4
spec/fabricators/accessible_access_token_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator :accessible_access_token, from: :access_token do
|
||||
expires_in { nil }
|
||||
revoked_at { nil }
|
||||
end
|
||||
4
spec/fabricators/account_domain_block_fabricator.rb
Normal file
4
spec/fabricators/account_domain_block_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:account_domain_block) do
|
||||
account
|
||||
domain 'example.com'
|
||||
end
|
||||
13
spec/fabricators/account_fabricator.rb
Normal file
13
spec/fabricators/account_fabricator.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
keypair = OpenSSL::PKey::RSA.new(2048)
|
||||
public_key = keypair.public_key.to_pem
|
||||
private_key = keypair.to_pem
|
||||
|
||||
Fabricator(:account) do
|
||||
transient :suspended, :silenced
|
||||
username { sequence(:username) { |i| "#{Faker::Internet.user_name(nil, %w(_))}#{i}" } }
|
||||
last_webfingered_at { Time.now.utc }
|
||||
public_key { public_key }
|
||||
private_key { private_key }
|
||||
suspended_at { |attrs| attrs[:suspended] ? Time.now.utc : nil }
|
||||
silenced_at { |attrs| attrs[:silenced] ? Time.now.utc : nil }
|
||||
end
|
||||
8
spec/fabricators/account_identity_proof_fabricator.rb
Normal file
8
spec/fabricators/account_identity_proof_fabricator.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
Fabricator(:account_identity_proof) do
|
||||
account
|
||||
provider 'keybase'
|
||||
provider_username { sequence(:provider_username) { |i| "#{Faker::Lorem.characters(15)}" } }
|
||||
token { sequence(:token) { |i| "#{i}#{Faker::Crypto.sha1()*2}"[0..65] } }
|
||||
verified false
|
||||
live false
|
||||
end
|
||||
4
spec/fabricators/account_moderation_note_fabricator.rb
Normal file
4
spec/fabricators/account_moderation_note_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:account_moderation_note) do
|
||||
content "MyText"
|
||||
account nil
|
||||
end
|
||||
4
spec/fabricators/account_pin_fabricator.rb
Normal file
4
spec/fabricators/account_pin_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:account_pin) do
|
||||
account nil
|
||||
target_account nil
|
||||
end
|
||||
6
spec/fabricators/account_stat_fabricator.rb
Normal file
6
spec/fabricators/account_stat_fabricator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Fabricator(:account_stat) do
|
||||
account nil
|
||||
statuses_count ""
|
||||
following_count ""
|
||||
followers_count ""
|
||||
end
|
||||
3
spec/fabricators/account_tag_stat_fabricator.rb
Normal file
3
spec/fabricators/account_tag_stat_fabricator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Fabricator(:account_tag_stat) do
|
||||
accounts_count ""
|
||||
end
|
||||
5
spec/fabricators/account_warning_fabricator.rb
Normal file
5
spec/fabricators/account_warning_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:account_warning) do
|
||||
account nil
|
||||
target_account nil
|
||||
text "MyText"
|
||||
end
|
||||
3
spec/fabricators/account_warning_preset_fabricator.rb
Normal file
3
spec/fabricators/account_warning_preset_fabricator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Fabricator(:account_warning_preset) do
|
||||
text "MyText"
|
||||
end
|
||||
5
spec/fabricators/admin_action_log_fabricator.rb
Normal file
5
spec/fabricators/admin_action_log_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator('Admin::ActionLog') do
|
||||
account nil
|
||||
action "MyString"
|
||||
target nil
|
||||
end
|
||||
5
spec/fabricators/application_fabricator.rb
Normal file
5
spec/fabricators/application_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:application, from: Doorkeeper::Application) do
|
||||
name 'Example'
|
||||
website 'http://example.com'
|
||||
redirect_uri 'http://example.com/callback'
|
||||
end
|
||||
6
spec/fabricators/assets/TEAPOT
Normal file
6
spec/fabricators/assets/TEAPOT
Normal file
@@ -0,0 +1,6 @@
|
||||
This "Utah teapot" photograph is licensed under the Creative Commons
|
||||
Attribution-Share Alike 3.0 Unported license:
|
||||
https://creativecommons.org/licenses/by-sa/3.0/deed.en
|
||||
|
||||
Original source of work:
|
||||
https://commons.wikimedia.org/wiki/File:Utah_teapot_simple_2.png
|
||||
BIN
spec/fabricators/assets/utah_teapot.png
Normal file
BIN
spec/fabricators/assets/utah_teapot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 242 KiB |
3
spec/fabricators/backup_fabricator.rb
Normal file
3
spec/fabricators/backup_fabricator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Fabricator(:backup) do
|
||||
user
|
||||
end
|
||||
4
spec/fabricators/block_fabricator.rb
Normal file
4
spec/fabricators/block_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:block) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
end
|
||||
6
spec/fabricators/conversation_account_fabricator.rb
Normal file
6
spec/fabricators/conversation_account_fabricator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Fabricator(:conversation_account) do
|
||||
account nil
|
||||
conversation nil
|
||||
participant_account_ids ""
|
||||
last_status nil
|
||||
end
|
||||
2
spec/fabricators/conversation_fabricator.rb
Normal file
2
spec/fabricators/conversation_fabricator.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
Fabricator(:conversation) do
|
||||
end
|
||||
2
spec/fabricators/conversation_mute_fabricator.rb
Normal file
2
spec/fabricators/conversation_mute_fabricator.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
Fabricator(:conversation_mute) do
|
||||
end
|
||||
5
spec/fabricators/custom_emoji_fabricator.rb
Normal file
5
spec/fabricators/custom_emoji_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:custom_emoji) do
|
||||
shortcode 'coolcat'
|
||||
domain nil
|
||||
image { File.open(Rails.root.join('spec', 'fixtures', 'files', 'emojo.png')) }
|
||||
end
|
||||
6
spec/fabricators/custom_filter_fabricator.rb
Normal file
6
spec/fabricators/custom_filter_fabricator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Fabricator(:custom_filter) do
|
||||
account
|
||||
expires_at nil
|
||||
phrase 'discourse'
|
||||
context %w(home notifications)
|
||||
end
|
||||
3
spec/fabricators/domain_block_fabricator.rb
Normal file
3
spec/fabricators/domain_block_fabricator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Fabricator(:domain_block) do
|
||||
domain { sequence(:domain) { |i| "#{i}#{Faker::Internet.domain_name}" } }
|
||||
end
|
||||
3
spec/fabricators/email_domain_block_fabricator.rb
Normal file
3
spec/fabricators/email_domain_block_fabricator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Fabricator(:email_domain_block) do
|
||||
domain { sequence(:domain) { |i| "#{i}#{Faker::Internet.domain_name}" } }
|
||||
end
|
||||
4
spec/fabricators/favourite_fabricator.rb
Normal file
4
spec/fabricators/favourite_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:favourite) do
|
||||
account
|
||||
status
|
||||
end
|
||||
6
spec/fabricators/featured_tag_fabricator.rb
Normal file
6
spec/fabricators/featured_tag_fabricator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Fabricator(:featured_tag) do
|
||||
account
|
||||
tag
|
||||
statuses_count 1_337
|
||||
last_status_at Time.now.utc
|
||||
end
|
||||
4
spec/fabricators/follow_fabricator.rb
Normal file
4
spec/fabricators/follow_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:follow) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
end
|
||||
4
spec/fabricators/follow_request_fabricator.rb
Normal file
4
spec/fabricators/follow_request_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:follow_request) do
|
||||
account
|
||||
target_account { Fabricate(:account, locked: true) }
|
||||
end
|
||||
5
spec/fabricators/identity_fabricator.rb
Normal file
5
spec/fabricators/identity_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:identity) do
|
||||
user nil
|
||||
provider "MyString"
|
||||
uid "MyString"
|
||||
end
|
||||
2
spec/fabricators/import_fabricator.rb
Normal file
2
spec/fabricators/import_fabricator.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
Fabricator(:import) do
|
||||
end
|
||||
6
spec/fabricators/invite_fabricator.rb
Normal file
6
spec/fabricators/invite_fabricator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Fabricator(:invite) do
|
||||
user
|
||||
expires_at nil
|
||||
max_uses nil
|
||||
uses 0
|
||||
end
|
||||
5
spec/fabricators/list_account_fabricator.rb
Normal file
5
spec/fabricators/list_account_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:list_account) do
|
||||
list nil
|
||||
account nil
|
||||
follow nil
|
||||
end
|
||||
4
spec/fabricators/list_fabricator.rb
Normal file
4
spec/fabricators/list_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:list) do
|
||||
account
|
||||
title "MyString"
|
||||
end
|
||||
16
spec/fabricators/media_attachment_fabricator.rb
Normal file
16
spec/fabricators/media_attachment_fabricator.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
Fabricator(:media_attachment) do
|
||||
account
|
||||
file do |attrs|
|
||||
[
|
||||
case attrs[:type]
|
||||
when :gifv
|
||||
attachment_fixture ['attachment.gif', 'attachment.webm'].sample
|
||||
when :image
|
||||
attachment_fixture 'attachment.jpg'
|
||||
when nil
|
||||
attachment_fixture ['attachment.gif', 'attachment.jpg', 'attachment.webm'].sample
|
||||
end,
|
||||
nil
|
||||
].sample
|
||||
end
|
||||
end
|
||||
4
spec/fabricators/mention_fabricator.rb
Normal file
4
spec/fabricators/mention_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:mention) do
|
||||
account
|
||||
status
|
||||
end
|
||||
4
spec/fabricators/mute_fabricator.rb
Normal file
4
spec/fabricators/mute_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:mute) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
end
|
||||
4
spec/fabricators/notification_fabricator.rb
Normal file
4
spec/fabricators/notification_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:notification) do
|
||||
activity fabricator: [:mention, :status, :follow, :follow_request, :favourite].sample
|
||||
account
|
||||
end
|
||||
8
spec/fabricators/poll_fabricator.rb
Normal file
8
spec/fabricators/poll_fabricator.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
Fabricator(:poll) do
|
||||
account
|
||||
status
|
||||
expires_at { 7.days.from_now }
|
||||
options %w(Foo Bar)
|
||||
multiple false
|
||||
hide_totals false
|
||||
end
|
||||
5
spec/fabricators/poll_vote_fabricator.rb
Normal file
5
spec/fabricators/poll_vote_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:poll_vote) do
|
||||
account
|
||||
poll
|
||||
choice 0
|
||||
end
|
||||
4
spec/fabricators/relay_fabricator.rb
Normal file
4
spec/fabricators/relay_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:relay) do
|
||||
inbox_url "https://example.com/inbox"
|
||||
state :idle
|
||||
end
|
||||
6
spec/fabricators/report_fabricator.rb
Normal file
6
spec/fabricators/report_fabricator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Fabricator(:report) do
|
||||
account
|
||||
target_account { Fabricate(:account) }
|
||||
comment "You nasty"
|
||||
action_taken false
|
||||
end
|
||||
5
spec/fabricators/report_note_fabricator.rb
Normal file
5
spec/fabricators/report_note_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:report_note) do
|
||||
report
|
||||
account { Fabricate(:account) }
|
||||
content "Test Content"
|
||||
end
|
||||
4
spec/fabricators/scheduled_status_fabricator.rb
Normal file
4
spec/fabricators/scheduled_status_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:scheduled_status) do
|
||||
account
|
||||
scheduled_at { 20.hours.from_now }
|
||||
end
|
||||
4
spec/fabricators/session_activation_fabricator.rb
Normal file
4
spec/fabricators/session_activation_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:session_activation) do
|
||||
user
|
||||
session_id "MyString"
|
||||
end
|
||||
4
spec/fabricators/setting_fabricator.rb
Normal file
4
spec/fabricators/setting_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:setting) do
|
||||
end
|
||||
3
spec/fabricators/site_upload_fabricator.rb
Normal file
3
spec/fabricators/site_upload_fabricator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Fabricator(:site_upload) do
|
||||
file { File.open(File.join(Rails.root, 'spec', 'fabricators', 'assets', 'utah_teapot.png')) }
|
||||
end
|
||||
8
spec/fabricators/status_fabricator.rb
Normal file
8
spec/fabricators/status_fabricator.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
Fabricator(:status) do
|
||||
account
|
||||
text "Lorem ipsum dolor sit amet"
|
||||
|
||||
after_build do |status|
|
||||
status.uri = Faker::Internet.device_token if !status.account.local? && status.uri.nil?
|
||||
end
|
||||
end
|
||||
4
spec/fabricators/status_pin_fabricator.rb
Normal file
4
spec/fabricators/status_pin_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:status_pin) do
|
||||
account
|
||||
status
|
||||
end
|
||||
6
spec/fabricators/status_stat_fabricator.rb
Normal file
6
spec/fabricators/status_stat_fabricator.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
Fabricator(:status_stat) do
|
||||
status_id nil
|
||||
replies_count ""
|
||||
reblogs_count ""
|
||||
favourites_count ""
|
||||
end
|
||||
5
spec/fabricators/stream_entry_fabricator.rb
Normal file
5
spec/fabricators/stream_entry_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:stream_entry) do
|
||||
account
|
||||
activity { Fabricate(:status) }
|
||||
hidden { [true, false].sample }
|
||||
end
|
||||
7
spec/fabricators/subscription_fabricator.rb
Normal file
7
spec/fabricators/subscription_fabricator.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
Fabricator(:subscription) do
|
||||
account
|
||||
callback_url "http://example.com/callback"
|
||||
secret "foobar"
|
||||
expires_at "2016-11-28 11:30:07"
|
||||
confirmed false
|
||||
end
|
||||
3
spec/fabricators/tag_fabricator.rb
Normal file
3
spec/fabricators/tag_fabricator.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
Fabricator(:tag) do
|
||||
name { sequence(:hashtag) { |i| "#{Faker::Lorem.word}#{i}" } }
|
||||
end
|
||||
7
spec/fabricators/user_fabricator.rb
Normal file
7
spec/fabricators/user_fabricator.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
Fabricator(:user) do
|
||||
account
|
||||
email { sequence(:email) { |i| "#{i}#{Faker::Internet.email}" } }
|
||||
password "123456789"
|
||||
confirmed_at { Time.zone.now }
|
||||
agreement true
|
||||
end
|
||||
4
spec/fabricators/user_invite_request_fabricator.rb
Normal file
4
spec/fabricators/user_invite_request_fabricator.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
Fabricator(:user_invite_request) do
|
||||
user
|
||||
text { Faker::Lorem.sentence }
|
||||
end
|
||||
5
spec/fabricators/web_push_subscription_fabricator.rb
Normal file
5
spec/fabricators/web_push_subscription_fabricator.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
Fabricator(:web_push_subscription, from: Web::PushSubscription) do
|
||||
endpoint Faker::Internet.url
|
||||
key_p256dh Faker::Internet.password
|
||||
key_auth Faker::Internet.password
|
||||
end
|
||||
2
spec/fabricators/web_setting_fabricator.rb
Normal file
2
spec/fabricators/web_setting_fabricator.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
Fabricator(:web_setting, from: Web::Setting) do
|
||||
end
|
||||
Reference in New Issue
Block a user