Browse files

debugging, but I have no idea how to make this work in a full rake

  • Loading branch information...
1 parent f5be97a commit d7a273138d220586c8d18960c4f365971a6db13e @mike-burns mike-burns committed with jyurek Jul 25, 2012
Showing with 22 additions and 4 deletions.
  1. +16 −2 features/step_definitions/mvc_steps.rb
  2. +2 −2 features/step_definitions/rails_steps.rb
  3. +4 −0 lib/paperclip/attachment.rb
View
18 features/step_definitions/mvc_steps.rb
@@ -24,6 +24,10 @@ class User < ActiveRecord::Base
visit '/users/new'
attach_file('Avatar', File.expand_path('test/fixtures/5k.png'))
click_button 'Submit'
+
+ in_current_dir do
+ puts `find public -type f`
+ end
end
When /^I add the following style to the user avatar:$/ do |string|
@@ -46,10 +50,16 @@ class User < ActiveRecord::Base
user.should_not be_nil
visit "/users/#{user.to_param}"
- page.source =~ %r{img alt="5k" src="/([^"]+)\?.*"}
+ page.source =~ %r{img alt="5k" src="/([^"]+large[^"]+)\?.*"}
image_path = $1
image_path.should_not be_blank
+ in_current_dir do
+ puts `find public -type f`
+ end
+
+ p Rails.root.join('public',image_path)
+ puts `ls -l #{Rails.root.join('public',image_path)}`
File.should_not be_exist(Rails.root.join('public',image_path))
end
@@ -80,9 +90,13 @@ class #{migration_name.classify} < ActiveRecord::Migration
user.should_not be_nil
visit "/users/#{user.to_param}"
- page.source =~ %r{img alt="5k" src="/([^"]+)\?.*"}
+ page.source =~ %r{img alt="5k" src="/([^"]+large[^"]+)\?.*"}
image_path = $1
image_path.should_not be_blank
+ in_current_dir do
+ puts `find public -type f`
+ end
+
File.should be_exist(Rails.root.join('public',image_path))
end
View
4 features/step_definitions/rails_steps.rb
@@ -1,6 +1,6 @@
Given /^I generate a new rails application$/ do
- in_current_dir do
- FileUtils.rm_rf(APP_NAME)
+ if defined?(Paperclip::Attachment)
+ Paperclip::Attachment.reset
end
steps %{
View
4 lib/paperclip/attachment.rb
@@ -32,6 +32,10 @@ def self.default_options
}
end
+ def self.reset
+ @default_options = nil
+ end
+
attr_reader :name, :instance, :default_style, :convert_options, :queued_for_write, :whiny,
:options, :interpolator, :source_file_options, :whiny
attr_accessor :post_processing

0 comments on commit d7a2731

Please sign in to comment.