Commit 1ded077b by Mark Kremer Committed by Mike Burns

Re-arranged the cucumber features

parent 0354f662
...@@ -8,12 +8,15 @@ Feature: Rails integration ...@@ -8,12 +8,15 @@ Feature: Rails integration
And I update my new user view to include the file upload field And I update my new user view to include the file upload field
And I update my user view to include the attachment 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: Given I add this snippet to the User model:
""" """
attr_accessible :name, :attachment attr_accessible :name, :attachment
has_attached_file :attachment, :url => "/system/:attachment/:style/:filename", has_attached_file :attachment
:styles => { :square => "100x100#" }
""" """
And I start the rails application And I start the rails application
When I go to the new user page When I go to the new user page
...@@ -21,18 +24,14 @@ Feature: Rails integration ...@@ -21,18 +24,14 @@ Feature: Rails integration
And I attach the file "test/fixtures/5k.png" to "Attachment" And I attach the file "test/fixtures/5k.png" to "Attachment"
And I press "Submit" And I press "Submit"
Then I should see "Name: something" Then I should see "Name: something"
And I should see an image with a path of "/system/attachments/original/5k.png" And I should see an image with a path of "/paperclip/custom/attachments/original/5k.png"
And the file at "/system/attachments/original/5k.png" should be the same as "test/fixtures/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 Scenario: Filesystem integration test
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: Given I add this snippet to the User model:
""" """
attr_accessible :name, :attachment attr_accessible :name, :attachment
has_attached_file :attachment has_attached_file :attachment, :url => "/system/:attachment/:style/:filename"
""" """
And I start the rails application And I start the rails application
When I go to the new user page When I go to the new user page
...@@ -40,8 +39,8 @@ Feature: Rails integration ...@@ -40,8 +39,8 @@ Feature: Rails integration
And I attach the file "test/fixtures/5k.png" to "Attachment" And I attach the file "test/fixtures/5k.png" to "Attachment"
And I press "Submit" And I press "Submit"
Then I should see "Name: something" Then I should see "Name: something"
And I should see an image with a path of "/paperclip/custom/attachments/original/5k.png" And I should see an image with a path of "/system/attachments/original/5k.png"
And the file at "/paperclip/custom/attachments/original/5k.png" should be the same as "test/fixtures/5k.png" And the file at "/system/attachments/original/5k.png" should be the same as "test/fixtures/5k.png"
Scenario: S3 Integration test Scenario: S3 Integration test
Given I add this snippet to the User model: Given I add this snippet to the User model:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment