Skip to content

Commit

Permalink
fix deprecations for rails 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio Contin authored and Jon Yurek committed Jan 3, 2014
1 parent c7c5291 commit f79ec49
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions shoulda_macros/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ def paperclip_fixture(model, attachment, extension)
end
end

if defined?(ActionController::Integration::Session)
if defined?(ActionDispatch::Integration::Session)
class ActionDispatch::IntegrationTest::Session #:nodoc:
include Paperclip::Shoulda
end
elsif defined?(ActionController::Integration::Session)
class ActionController::Integration::Session #:nodoc:
include Paperclip::Shoulda
end
Expand All @@ -119,6 +123,13 @@ class Factory
end
end

class Test::Unit::TestCase #:nodoc:
extend Paperclip::Shoulda
if defined?(Minitest)
class Minitest::Unit::TestCase #:nodoc:
extend Paperclip::Shoulda
end
elsif defined?(Test)
class Test::Unit::TestCase #:nodoc:
extend Paperclip::Shoulda
end
end

0 comments on commit f79ec49

Please sign in to comment.