spec/webmock_helpers.rb in softcover-1.0.beta1 vs spec/webmock_helpers.rb in softcover-1.0.beta2
- old
+ new
@@ -65,11 +65,12 @@
testimonials: book.testimonials,
marketing_content: '',
contact_email: book.contact_email,
hide_softcover_footer: book.hide_custom_domain_footer,
authors: book.authors,
- ga_account: book.ga_account
+ ga_account: book.ga_account,
+ remove_unused_media_bundles: true
}.to_json,
:headers => headers).
to_return(:status => 200, :body => return_body, :headers => {})
stub_s3_post
@@ -120,20 +121,23 @@
stub_request(:post, /s3\.amazonaws\.com/).
with(:body => /.*/).
to_return(:status => 200, :body => "", :headers => {})
end
- def stub_media_upload(book, dir='ebooks')
+ def stub_media_upload(book, dir='ebooks', options={})
stub_s3_post
stub_create_book(book)
files = book.get_book_files(dir)
stub_request(:post,
/\/books\/#{book.id || '.+'}\/media/).
with(:body => {
path: dir,
files: files,
- manifest: nil}.to_json,
+ manifest: nil,
+ remove_unused_media_files:
+ options[:remove_unused_media_files]
+ }.to_json,
:headers => headers).
to_return(:status => 200, :body => {
upload_params: files.map { |file|
{
:policy => "asdf",
\ No newline at end of file