From e0a7e0fec760ba12c8067a37e10c96f1f05876e2 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 24 Jun 2026 04:13:16 +0200 Subject: Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade - Converted plugins to gems (Gemfile) - Updated config structure (application.rb, boot.rb, environment.rb) - Converted routes to Rails 3 DSL - Converted named_scope to scope throughout models - Converted find(:all, :conditions) to where() chains - Fixed has_many :order to use ordering scope - Updated session store and secret token configuration - Fixed exception_notification middleware configuration - Patched Ruby 2.4 / Rails 3.2 incompatibilities: - Integer/Float duration arithmetic (ActiveSupport) - Arel visit_Integer for PostgreSQL adapter - create_database String/Integer coercion - ActionController consider_all_requests_local - Migrated taggings schema for acts-as-taggable-on - Replaced dynamic_form gem with custom form_error_messages helper - Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for) - Fixed admin layout yield - Updated test suite for Rails 3 APIs --- .../plugins/paperclip/shoulda_macros/paperclip.rb | 68 ---------------------- 1 file changed, 68 deletions(-) delete mode 100644 vendor/plugins/paperclip/shoulda_macros/paperclip.rb (limited to 'vendor/plugins/paperclip/shoulda_macros') diff --git a/vendor/plugins/paperclip/shoulda_macros/paperclip.rb b/vendor/plugins/paperclip/shoulda_macros/paperclip.rb deleted file mode 100644 index d6903578..00000000 --- a/vendor/plugins/paperclip/shoulda_macros/paperclip.rb +++ /dev/null @@ -1,68 +0,0 @@ -require 'paperclip/matchers' - -module Paperclip - # =Paperclip Shoulda Macros - # - # These macros are intended for use with shoulda, and will be included into - # your tests automatically. All of the macros use the standard shoulda - # assumption that the name of the test is based on the name of the model - # you're testing (that is, UserTest is the test for the User model), and - # will load that class for testing purposes. - module Shoulda - include Matchers - # This will test whether you have defined your attachment correctly by - # checking for all the required fields exist after the definition of the - # attachment. - def should_have_attached_file name - klass = self.name.gsub(/Test$/, '').constantize - matcher = have_attached_file name - should matcher.description do - assert_accepts(matcher, klass) - end - end - - # Tests for validations on the presence of the attachment. - def should_validate_attachment_presence name - klass = self.name.gsub(/Test$/, '').constantize - matcher = validate_attachment_presence name - should matcher.description do - assert_accepts(matcher, klass) - end - end - - # Tests that you have content_type validations specified. There are two - # options, :valid and :invalid. Both accept an array of strings. The - # strings should be a list of content types which will pass and fail - # validation, respectively. - def should_validate_attachment_content_type name, options = {} - klass = self.name.gsub(/Test$/, '').constantize - valid = [options[:valid]].flatten - invalid = [options[:invalid]].flatten - matcher = validate_attachment_content_type(name).allowing(valid).rejecting(invalid) - should matcher.description do - assert_accepts(matcher, klass) - end - end - - # Tests to ensure that you have file size validations turned on. You - # can pass the same options to this that you can to - # validate_attachment_file_size - :less_than, :greater_than, and :in. - # :less_than checks that a file is less than a certain size, :greater_than - # checks that a file is more than a certain size, and :in takes a Range or - # Array which specifies the lower and upper limits of the file size. - def should_validate_attachment_size name, options = {} - klass = self.name.gsub(/Test$/, '').constantize - min = options[:greater_than] || (options[:in] && options[:in].first) || 0 - max = options[:less_than] || (options[:in] && options[:in].last) || (1.0/0) - range = (min..max) - matcher = validate_attachment_size(name).in(range) - should matcher.description do - assert_accepts(matcher, klass) - end - end - end -end - -class Test::Unit::TestCase #:nodoc: - extend Paperclip::Shoulda -end -- cgit v1.3