diff --git a/.overcommit.yml b/.overcommit.yml index cf55ccd..e6f8a6c 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -28,4 +28,6 @@ PreCommit: enabled: true description: "Generate the Swagger JSON file" on_warn: fail + env: + RAILS_ENV: test command: ["bundle", "exec", "rails", "rswag"] diff --git a/spec/requests/auctions_spec.rb b/spec/requests/auctions_spec.rb index 69e0004..1e7930d 100644 --- a/spec/requests/auctions_spec.rb +++ b/spec/requests/auctions_spec.rb @@ -16,16 +16,16 @@ items: { type: :object, properties: { - id: {type: :integer, example: rand(1..10_000)}, - title: {type: :string, example: Faker::Commerce.product_name}, - description: {type: :string, example: Faker::Lorem.paragraph}, + id: {type: :integer, example: 1}, + title: {type: :string, example: "Lightweight Iron Lamp"}, + description: {type: :string, example: "Quo quidem veniam. Sunt tempora ratione. Aut culpa qui."}, started_at: {type: :string, format: :"date-time", example: "2024-04-30T18:04:51.156934"}, finished_at: {type: :string, format: :"date-time", example: "2024-04-30T18:04:51.156934"}, initial_bid_cents: {type: :integer, example: 100}, kind: {type: :string, example: "standard"}, status: {type: :string, example: "running"}, stopwatch: {type: :integer, example: 30}, - total_bids: {type: :integer, example: rand(1..10_000)}, + total_bids: {type: :integer, example: 1}, bids: { type: :object, properties: { @@ -36,9 +36,9 @@ items: { type: :object, properties: { - id: {type: :integer, example: rand(1..10_000)}, - user_id: {type: :integer, example: rand(1..10_000)}, - name: {type: :string, example: Faker::Name.name}, + id: {type: :integer, example: 1}, + user_id: {type: :integer, example: 2}, + name: {type: :string, example: "Beatriz Louzada"}, value: {type: :integer, example: 1000}, date: {type: :string, format: :"date-time", example: "2024-04-30T18:04:51.156934"} } diff --git a/swagger/v1/swagger.yaml b/swagger/v1/swagger.yaml index 5dac66e..01a8999 100644 --- a/swagger/v1/swagger.yaml +++ b/swagger/v1/swagger.yaml @@ -40,14 +40,14 @@ paths: properties: id: type: integer - example: 9060 + example: 1 title: type: string - example: Enormous Copper Bag + example: Lightweight Iron Lamp description: type: string - example: Omnis adipisci sit. In molestias pariatur. Inventore - voluptates nobis. + example: Quo quidem veniam. Sunt tempora ratione. Aut culpa + qui. started_at: type: string format: date-time @@ -70,7 +70,7 @@ paths: example: 30 total_bids: type: integer - example: 3724 + example: 1 bids: type: object properties: @@ -87,13 +87,13 @@ paths: properties: id: type: integer - example: 9382 + example: 1 user_id: type: integer - example: 3391 + example: 2 name: type: string - example: Yago Pires + example: Beatriz Louzada value: type: integer example: 1000