Commit Graph

8 Commits

Author SHA1 Message Date
Blake Erickson
989aab656f
Revert "Add a macro for complexes multiparts" 2021-03-06 14:52:49 -07:00
Blake Erickson
f7036b7e5a
Merge pull request #300 from sobrinho/master
Add a macro for complexes multiparts
2021-03-06 10:22:54 -07:00
Jamie Macey
08b1678e53 skip a test requiring headless firefox capybara driver 2020-10-12 13:37:57 -07:00
Gabriel Sobrinho
f8dbd98bbc
Add a macro for complexes multiparts
This will allow to describe multipart in a short way, like JSON payload:

Before:

    put 'Creates a blog with thumbnail' do
      consumes 'multipart/form-data'
      parameter name: :title, in: :formData, type: :string, required: true
      parameter name: :content, in: :formData, type: :string, required: true
      parameter name: :file, in: :formData, type: :file, required: true

      let(:blog) { FactoryBot.build(:blog) }
      let(:title) { blog.title }
      let(:content) { blog.content }
      let(:file) { blog.file }

      ...
    end

After:

    put 'Creates a blog with thumbnail' do
      consumes 'multipart/form-data'
      parameter name: :blog, in: :formData, schema: { '$ref' => '#/definitions/blog' }

      let(:blog) { FactoryBot.attributes_for(:blog) }

      ...
    end

Your mileage may vary but you can always choose the best option.
2020-04-16 22:38:35 -03:00
hdpuk86
db45cafea2 merge master fork 2019-10-24 21:17:23 +01:00
Nathan Broadbent
e5eb44191c Use RSpec.describe to fix IRB context warning in Rails console 2019-10-17 16:40:31 +07:00
Hayley
d01dff199c potential test fix 2019-10-08 16:43:11 +01:00
richie
99be8135f7 Wire up capybara & add simple feature spec for swagger-ui 2016-11-08 12:38:51 -08:00