Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use build in ExampleBot instead of create + rollback #965

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/factories/invitations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
sequence(:email) { |n| "example#{n}@email.com" }

factory :invitation_example do
id { 42 }
from_membership_id { 42 }
team { FactoryBot.example(:team) }
membership { FactoryBot.example(:membership) }
end
Expand Down
3 changes: 3 additions & 0 deletions test/factories/memberships.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
association :team

factory :membership_example do
id { 42 }
team { FactoryBot.example(:team) }
user { FactoryBot.example(:user, teams: [team]) }
invitation_id { nil }
Expand All @@ -14,6 +15,8 @@
platform_agent_of_id { nil }
platform_agent { false }
role_ids { ["admin"] }
created_at { DateTime.new(2023, 1, 1) }
updated_at { DateTime.new(2023, 1, 2) }

# The `added_by` attribute is an optional foreign_key which points
# to another membership and is automatically populated when someone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
sort_order { 1 }

factory :scaffolding_completely_concrete_tangible_thing_example do
id { 42 }
absolutely_abstract_creative_concept_id { 42 }
text_field_value { "Example" }
created_at { DateTime.new(2023, 1, 1) }
updated_at { DateTime.new(2023, 1, 2) }
end
end
end
3 changes: 3 additions & 0 deletions test/factories/teams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
locale { nil }

factory :team_example do
id { 42 }
sequence(:name) { |n| "EXAMPLE Generic Team #{n}" }
sequence(:slug) { |n| "EXAMPLE team_#{n}" }
time_zone { ActiveSupport::TimeZone.all.first.name }
locale { "en" }
created_at { DateTime.new(2023, 1, 1) }
updated_at { DateTime.new(2023, 1, 2) }
end
end
end
3 changes: 3 additions & 0 deletions test/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
end

factory :user_example do
id { 42 }
first_name { "Example First Name" }
last_name { "Example Last Name" }
created_at { DateTime.new(2023, 1, 1) }
updated_at { DateTime.new(2023, 1, 2) }
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions test/factories/webhooks/outgoing/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
url { "https://example.com/some-endpoint-url" }

factory :webhooks_outgoing_endpoint_example do
id { 42 }
team_id { 42 }
name { "Example Endpoint" }
created_at { DateTime.new(2023, 1, 1) }
updated_at { DateTime.new(2023, 1, 2) }
end
end
end
11 changes: 8 additions & 3 deletions test/factories/webhooks/outgoing/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
end

factory :webhooks_outgoing_event_example do
id { 42 }
subject_id { 42 }
team_id { 42 }
created_at { DateTime.new(2023, 1, 1) }
updated_at { DateTime.new(2023, 1, 2) }
data {
{id: 1,
created_at: Time.now.utc,
updated_at: Time.now.utc,
{id: 42,
created_at: DateTime.new(2023, 1, 1).utc,
updated_at: DateTime.new(2023, 1, 2).utc,
value: "one"}.to_json
}
end
Expand Down
Loading