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

File_upload/support for multi-part media upload #175

Open
NataliaAru opened this issue Aug 2, 2018 · 6 comments
Open

File_upload/support for multi-part media upload #175

NataliaAru opened this issue Aug 2, 2018 · 6 comments

Comments

@NataliaAru
Copy link

NataliaAru commented Aug 2, 2018

I am trying to write a pact test in Ruby, where consumer makes a post call with
payload{
multipart: true,
file: fileObject,
name: "name"
}
where file is some kind of media file.
please, make support for this feature

@bethesque
Copy link
Member

Are you interested in working on this with me @NataliaAru?

@NataliaAru
Copy link
Author

NataliaAru commented Aug 3, 2018

@bethesque I don't have much experience, but i would love to contribute if I can!

@bethesque
Copy link
Member

bethesque commented Aug 6, 2018

Ok, I've released version 1.33.0 with support for multipart/form matching. Here's an example of how to do the matching:

https://github.com/pact-foundation/pact-ruby/blob/master/spec/features/consumer_with_file_upload_spec.rb

As you can see, the interface is a bit clunky compared to the Groovy

If you're interested in contributing, you could have a go at making a nicer way of creating the expected upload body and headers?

file_upload_service
       .upon_receiving("a request to upload a file")
       .with(method: :post, path: '/files')
       .and_file('file', 'text.txt', 'text/plain', File.read(file_to_upload))
        will_respond_with(status: 200)

@bethesque
Copy link
Member

@NataliaAru
Copy link
Author

ah, I will test this against our project and try to do the interface!

@bethesque
Copy link
Member

Closing due to inactivity, but please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants