Skip to content

Commit

Permalink
Re-arranged the cucumber features
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkcor authored and mike-burns committed May 31, 2012
1 parent 0354f66 commit 1ded077
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions features/basic_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,39 @@ Feature: Rails integration
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
Scenario: Configure defaults for all attachments through Railtie
Given I add this snippet to config/application.rb:
"""
config.paperclip_defaults = {:url => "/paperclip/custom/:attachment/:style/:filename"}
"""
Given I add this snippet to the User model:
"""
attr_accessible :name, :attachment
has_attached_file :attachment, :url => "/system/:attachment/:style/:filename",
:styles => { :square => "100x100#" }
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/original/5k.png"
And the file at "/system/attachments/original/5k.png" should be the same as "test/fixtures/5k.png"
And I should see an image with a path of "/paperclip/custom/attachments/original/5k.png"
And the file at "/paperclip/custom/attachments/original/5k.png" should be the same as "test/fixtures/5k.png"

Scenario: Configure defaults for all attachments through Railtie
Given I add this snippet to config/application.rb:
"""
config.paperclip_defaults = {:url => "/paperclip/custom/:attachment/:style/:filename"}
"""
Scenario: Filesystem integration test
Given I add this snippet to the User model:
"""
attr_accessible :name, :attachment
has_attached_file :attachment
has_attached_file :attachment, :url => "/system/:attachment/:style/:filename"
"""
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 "/paperclip/custom/attachments/original/5k.png"
And the file at "/paperclip/custom/attachments/original/5k.png" should be the same as "test/fixtures/5k.png"
And I should see an image with a path of "/system/attachments/original/5k.png"
And the file at "/system/attachments/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:
Expand Down

0 comments on commit 1ded077

Please sign in to comment.