Sha256: df6d15970cd88305a610a1713d67f32635f3f13f22447165140aaf80edcc2497

Contents?: true

Size: 557 Bytes

Versions: 27

Compression:

Stored size: 557 Bytes

Contents

When /^I attach the file "([^"]*)" to "([^"]*)" on S3$/ do |file_path, field|
  definition = User.attachment_definitions[field.downcase.to_sym]
  path = "https://paperclip.s3.amazonaws.com#{definition[:path]}"
  path.gsub!(':filename', File.basename(file_path))
  path.gsub!(/:([^\/\.]+)/) do |match|
    "([^\/\.]+)"
  end
  FakeWeb.register_uri(:put, Regexp.new(path), :body => "OK")
  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

27 entries across 27 versions & 3 rubygems

Version Path
paperclip-v2_7-patched-ruby-1_8_6-2.7.5 features/step_definitions/s3_steps.rb
paperclip-3.4.2 features/step_definitions/s3_steps.rb
paperclip-3.4.1 features/step_definitions/s3_steps.rb
paperclip-2.7.5 features/step_definitions/s3_steps.rb
paperclip-3.4.0 features/step_definitions/s3_steps.rb
paperclip-2.7.4 features/step_definitions/s3_steps.rb
paperclip-3.3.1 features/step_definitions/s3_steps.rb
paperclip-2.7.2 features/step_definitions/s3_steps.rb
paperclip-3.2.1 features/step_definitions/s3_steps.rb
paperclip-2.8.0 features/step_definitions/s3_steps.rb
paperclip-3.3.0 features/step_definitions/s3_steps.rb
paperclip-2.7.1 features/step_definitions/s3_steps.rb
paperclip-3.2.0 features/step_definitions/s3_steps.rb
paperclip-3.1.4 features/step_definitions/s3_steps.rb
paperclip-3.1.2 features/step_definitions/s3_steps.rb
paperclip-3.1.1 features/step_definitions/s3_steps.rb
paperclip-3.1.0 features/step_definitions/s3_steps.rb
paperclip-3.0.4 features/step_definitions/s3_steps.rb
paperclip-3.0.3 features/step_definitions/s3_steps.rb
cloudfuji_paperclip-3.0.3 features/step_definitions/s3_steps.rb