spec/webmock_helpers.rb in softcover-0.9.20 vs spec/webmock_helpers.rb in softcover-0.9.21
- old
+ new
@@ -120,17 +120,20 @@
stub_request(:post, /s3\.amazonaws\.com/).
with(:body => /.*/).
to_return(:status => 200, :body => "", :headers => {})
end
- def stub_media_upload(book)
+ def stub_media_upload(book, dir='ebooks')
stub_s3_post
stub_create_book(book)
- files = book.find_screencasts
+ files = book.get_book_files(dir)
stub_request(:post,
- "#{api_base_url}/books/#{book.id}/media").
- with(:body => {files: files }.to_json,
+ /\/books\/#{book.id || '.+'}\/media/).
+ with(:body => {
+ path: dir,
+ files: files,
+ manifest: nil}.to_json,
:headers => headers).
to_return(:status => 200, :body => {
upload_params: files.map { |file|
{
:policy => "asdf",
\ No newline at end of file