Skip to content

Commit

Permalink
Update example factories to match previous OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
newstler committed Oct 9, 2023
1 parent 7e17a74 commit 6a2e11b
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 16 deletions.
1 change: 0 additions & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true

config.cache_store = :memory_store
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
Expand Down
4 changes: 2 additions & 2 deletions test/factories/invitations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
sequence(:email) { |n| "example#{n}@email.com" }

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

factory :membership_example do
id { "42" }
id { 42 }
team { FactoryBot.example(:team) }
user { FactoryBot.example(:user, teams: [team]) }
invitation_id { nil }
Expand All @@ -15,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,9 +15,11 @@
sort_order { 1 }

factory :scaffolding_completely_concrete_tangible_thing_example do
id { "42" }
absolutely_abstract_creative_concept_id { "42" }
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
4 changes: 3 additions & 1 deletion test/factories/teams.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
locale { nil }

factory :team_example do
id { "42" }
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
4 changes: 3 additions & 1 deletion test/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
end

factory :user_example do
id { "42" }
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
6 changes: 4 additions & 2 deletions test/factories/webhooks/outgoing/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
url { "https://example.com/some-endpoint-url" }

factory :webhooks_outgoing_endpoint_example do
id { "42" }
team_id { "42" }
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
14 changes: 8 additions & 6 deletions test/factories/webhooks/outgoing/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
end

factory :webhooks_outgoing_event_example do
id { "42" }
subject_id { "42" }
team_id { "42" }
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

0 comments on commit 6a2e11b

Please sign in to comment.