Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix rake task failure on Rails 3.2.3

  • Loading branch information...
commit f18755202fe3dd306dd21a5f445ff0d103dd7254 1 parent 7d84569
@sikachu sikachu authored
View
2  features/basic_integration.feature
@@ -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",
View
1  features/rake_tasks.feature
@@ -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"
"""
View
6 features/step_definitions/attachment_steps.rb
@@ -10,11 +10,13 @@ def attachment_path(filename)
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
Please sign in to comment.
Something went wrong with that request. Please try again.