Skip to content
Browse files

Re-arranged the cucumber features

  • Loading branch information...
1 parent 0354f66 commit 1ded077bda576c110d5e682634d3fcdfbc89fb39 @mkremer mkremer committed with mike-burns May 10, 2012
Showing with 12 additions and 13 deletions.
  1. +12 −13 features/basic_integration.feature
View
25 features/basic_integration.feature
@@ -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:

0 comments on commit 1ded077

Please sign in to comment.
Something went wrong with that request. Please try again.