Sha256: c036b0feeb8f9b943e43d2e8b995c0b9ae4dc1864463071507b71eb80beb7056

Contents?: true

Size: 598 Bytes

Versions: 14

Compression:

Stored size: 598 Bytes

Contents

When /^I attach the file "([^"]*)" to "([^"]*)" on S3$/ do |file_path, field|
  definition = Paperclip::AttachmentRegistry.definitions_for(User)[field.downcase.to_sym]
  path = "https://paperclip.s3.us-west-2.amazonaws.com#{definition[:path]}"
  path.gsub!(":filename", File.basename(file_path))
  path.gsub!(/:([^\/\.]+)/) do |_match|
    "([^\/\.]+)"
  end
  FakeWeb.register_uri(:put, Regexp.new(path), body: "<xml></xml>")
  step "I attach the file \"#{file_path}\" to \"#{field}\""
end

Then /^the file at "([^"]*)" should be uploaded to S3$/ do |url|
  FakeWeb.registered_uri?(:put, url)
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kt-paperclip-7.2.2 features/step_definitions/s3_steps.rb
kt-paperclip-7.2.1 features/step_definitions/s3_steps.rb
kt-paperclip-7.2.0 features/step_definitions/s3_steps.rb
kt-paperclip-6.4.2 features/step_definitions/s3_steps.rb
kt-paperclip-7.1.1 features/step_definitions/s3_steps.rb
kt-paperclip-7.1.0 features/step_definitions/s3_steps.rb
kt-paperclip-7.0.1 features/step_definitions/s3_steps.rb
kt-paperclip-7.0.0 features/step_definitions/s3_steps.rb
kt-paperclip-6.4.1 features/step_definitions/s3_steps.rb
kt-paperclip-6.4.0 features/step_definitions/s3_steps.rb
kt-paperclip-6.3.0 features/step_definitions/s3_steps.rb
kt-paperclip-6.2.2 features/step_definitions/s3_steps.rb
kt-paperclip-6.2.1 features/step_definitions/s3_steps.rb
kt-paperclip-6.2.0 features/step_definitions/s3_steps.rb