Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request jstorimer#78 from ScotterC/paperclip-4
Browse files Browse the repository at this point in the history
Testing Support for paperclip 4
  • Loading branch information
Scott Carleton committed Feb 19, 2014
2 parents f280c7c + 4b2d362 commit c4e6b32
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion delayed_paperclip.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.email = %w{[email protected] [email protected]}
s.homepage = %q{http://github.com/jrgifford/delayed_paperclip}

s.add_dependency 'paperclip', [">= 3.3", "< 4"]
s.add_dependency 'paperclip', [">= 3.3"]

s.add_development_dependency 'mocha'
s.add_development_dependency "rspec"
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails3_1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
delayed_paperclip (2.6.1)
paperclip (>= 3.3, < 4)
paperclip (>= 3.3)

GEM
remote: http://rubygems.org/
Expand Down Expand Up @@ -67,7 +67,7 @@ GEM
metaclass (~> 0.0.1)
mono_logger (1.1.0)
multi_json (1.8.4)
paperclip (3.5.4)
paperclip (4.1.0)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
cocaine (~> 0.5.3)
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails3_2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
delayed_paperclip (2.6.1)
paperclip (>= 3.3, < 4)
paperclip (>= 3.3)

GEM
remote: http://rubygems.org/
Expand Down Expand Up @@ -66,7 +66,7 @@ GEM
metaclass (~> 0.0.1)
mono_logger (1.1.0)
multi_json (1.8.4)
paperclip (3.5.4)
paperclip (4.1.0)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
cocaine (~> 0.5.3)
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/rails4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
delayed_paperclip (2.6.1)
paperclip (>= 3.3, < 4)
paperclip (>= 3.3)

GEM
remote: http://rubygems.org/
Expand Down Expand Up @@ -64,7 +64,7 @@ GEM
metaclass (~> 0.0.1)
mono_logger (1.1.0)
multi_json (1.8.4)
paperclip (3.5.4)
paperclip (4.1.0)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
cocaine (~> 0.5.3)
Expand Down
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

# Reset table and class with image_processing column or not
def reset_dummy(options = {})

options[:with_processed] = true unless options.key?(:with_processed)
options[:processed_column] = options[:with_processed] unless options.has_key?(:processed_column)
build_dummy_table(options.delete(:processed_column))
Expand Down Expand Up @@ -69,9 +68,11 @@ def reset_class(class_name, options)
klass.class_eval do
include Paperclip::Glue

has_attached_file :image, options[:paperclip]
has_attached_file :image, options[:paperclip]
options.delete(:paperclip)

validates_attachment :image, :content_type => { :content_type => "image/png" }

process_in_background :image, options if options[:with_processed]

after_update :reprocess if options[:with_after_update_callback]
Expand Down
4 changes: 3 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ def reset_class(class_name, options)
klass.class_eval do
include Paperclip::Glue

has_attached_file :image, options[:paperclip]
has_attached_file :image, options[:paperclip]
options.delete(:paperclip)

validates_attachment :image, :content_type => { :content_type => "image/png" }

process_in_background :image, options if options[:with_processed]

after_update :reprocess if options[:with_after_update_callback]
Expand Down

0 comments on commit c4e6b32

Please sign in to comment.