Sha256: 1a1a3915df16dc6aaa345390848477968e8ce505d5272ec3c348950a1d6b467c
Contents?: true
Size: 1.89 KB
Versions: 8
Compression:
Stored size: 1.89 KB
Contents
Feature: Rails integration Background: Given I generate a new rails application And I run a rails generator to generate a "User" scaffold with "name:string" And I run a paperclip generator to add a paperclip "attachment" to the "User" model And I run a migration And I update my new user view to include the file upload field And I update my user view to include the attachment Scenario: Filesystem integration test Given I add this snippet to the User model: """ has_attached_file :attachment """ And I start the rails application When I go to the new user page And I fill in "Name" with "something" And I attach the file "test/fixtures/5k.png" to "Attachment" And I press "Submit" Then I should see "Name: something" And I should see an image with a path of "/system/attachments/1/original/5k.png" And the file at "/system/attachments/1/original/5k.png" should be the same as "test/fixtures/5k.png" Scenario: S3 Integration test Given I add this snippet to the User model: """ has_attached_file :attachment, :storage => :s3, :path => "/:attachment/:id/:style/:filename", :s3_credentials => Rails.root.join("config/s3.yml") """ And I write to "config/s3.yml" with: """ bucket: paperclip access_key_id: access_key secret_access_key: secret_key """ And I start the rails application When I go to the new user page And I fill in "Name" with "something" And I attach the file "test/fixtures/5k.png" to "Attachment" on S3 And I press "Submit" Then I should see "Name: something" And I should see an image with a path of "http://s3.amazonaws.com/paperclip/attachments/1/original/5k.png" And the file at "http://s3.amazonaws.com/paperclip/attachments/1/original/5k.png" should be uploaded to S3
Version data entries
8 entries across 8 versions & 2 rubygems