Commit f1875520 by Prem Sichanugrist

Fix rake task failure on Rails 3.2.3

parent 7d845690
...@@ -11,6 +11,7 @@ Feature: Rails integration ...@@ -11,6 +11,7 @@ Feature: Rails integration
Scenario: Filesystem integration test Scenario: Filesystem integration test
Given I add this snippet to the User model: Given I add this snippet to the User model:
""" """
attr_accessible :name, :attachment
has_attached_file :attachment, :url => "/system/:attachment/:style/:filename" has_attached_file :attachment, :url => "/system/:attachment/:style/:filename"
""" """
And I start the rails application And I start the rails application
...@@ -25,6 +26,7 @@ Feature: Rails integration ...@@ -25,6 +26,7 @@ Feature: Rails integration
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:
""" """
attr_accessible :name, :attachment
has_attached_file :attachment, has_attached_file :attachment,
:storage => :s3, :storage => :s3,
:path => "/:attachment/:style/:filename", :path => "/:attachment/:style/:filename",
......
...@@ -7,6 +7,7 @@ Feature: Rake tasks ...@@ -7,6 +7,7 @@ Feature: Rake tasks
And I run a migration And I run a migration
And I add this snippet to the User model: And I add this snippet to the User model:
""" """
attr_accessible :name, :attachment
has_attached_file :attachment, :path => ":rails_root/public/system/:attachment/:style/:filename" has_attached_file :attachment, :path => ":rails_root/public/system/:attachment/:style/:filename"
""" """
......
...@@ -10,11 +10,13 @@ end ...@@ -10,11 +10,13 @@ end
World(AttachmentHelpers) World(AttachmentHelpers)
When /^I modify my attachment definition to:$/ do |definition| When /^I modify my attachment definition to:$/ do |definition|
write_file "app/models/user.rb", <<-FILE content = in_current_dir { File.read("app/models/user.rb") }
class User < ActiveRecord::Base content.gsub!(/has_attached_file.+end/m, <<-FILE)
#{definition} #{definition}
end end
FILE FILE
write_file "app/models/user.rb", content
in_current_dir { FileUtils.rm_rf ".rbx" } in_current_dir { FileUtils.rm_rf ".rbx" }
end end
......
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