Sha256: d5d2b91710852c305e6ffe6bccb3e6d5d83ce7f03bf388c16e4d3588fa12b264

Contents?: true

Size: 600 Bytes

Versions: 6

Compression:

Stored size: 600 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

6 entries across 6 versions & 2 rubygems

Version Path
kt-paperclip-5.4.0 features/step_definitions/s3_steps.rb
paperclip-6.1.0 features/step_definitions/s3_steps.rb
paperclip-6.0.0 features/step_definitions/s3_steps.rb
paperclip-5.3.0 features/step_definitions/s3_steps.rb
paperclip-5.2.1 features/step_definitions/s3_steps.rb
paperclip-5.2.0 features/step_definitions/s3_steps.rb