Commit f1875520 by Prem Sichanugrist

Fix rake task failure on Rails 3.2.3

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