Sha256: 9b49ab88182dfb848236e6489183dcf963a74501bd7ce8dd499f50fd435f4856

Contents?: true

Size: 581 Bytes

Versions: 27

Compression:

Stored size: 581 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.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 25 versions & 4 rubygems

Version Path
kt-paperclip-4.4.0 features/step_definitions/s3_steps.rb
paperclip-4.3.7 features/step_definitions/s3_steps.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/paperclip-4.3.6/features/step_definitions/s3_steps.rb
paperclip-4.3.6 features/step_definitions/s3_steps.rb
paperclip-4.3.5 features/step_definitions/s3_steps.rb
paperclip-4.3.4 features/step_definitions/s3_steps.rb
paperclip-4.3.3 features/step_definitions/s3_steps.rb
paperclip-4.3.2 features/step_definitions/s3_steps.rb
paperclip-4.3.1 features/step_definitions/s3_steps.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/paperclip-4.2.4/features/step_definitions/s3_steps.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/paperclip-4.2.4/features/step_definitions/s3_steps.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.2/features/step_definitions/s3_steps.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.4/features/step_definitions/s3_steps.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/paperclip-4.2.3/features/step_definitions/s3_steps.rb
paperclip-4.3.0 features/step_definitions/s3_steps.rb
paperclip-4.2.4 features/step_definitions/s3_steps.rb
paperclip-4.2.3 features/step_definitions/s3_steps.rb
paperclip-4.2.2 features/step_definitions/s3_steps.rb
paperclip-4.2.1 features/step_definitions/s3_steps.rb
paperclip-4.2.0 features/step_definitions/s3_steps.rb