mirror of
https://github.com/kemko/paperclip.git
synced 2026-01-01 16:05:40 +03:00
Восстанавливаем прохождение тестов в matchers/have_attached_file_matcher_test.rb
This commit is contained in:
@@ -31,9 +31,9 @@ module Paperclip
|
||||
|
||||
def responds?
|
||||
methods = @subject.instance_methods
|
||||
methods.include?("#{@attachment_name}") &&
|
||||
methods.include?("#{@attachment_name}=") &&
|
||||
methods.include?("#{@attachment_name}?")
|
||||
methods.include?(:"#{@attachment_name}") &&
|
||||
methods.include?(:"#{@attachment_name}=") &&
|
||||
methods.include?(:"#{@attachment_name}?")
|
||||
end
|
||||
|
||||
def has_column?
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'test_helper'
|
||||
|
||||
class HaveAttachedFileMatcherTest < Test::Unit::TestCase
|
||||
@@ -5,7 +7,7 @@ class HaveAttachedFileMatcherTest < Test::Unit::TestCase
|
||||
setup do
|
||||
@dummy_class = reset_class "Dummy"
|
||||
reset_table "dummies"
|
||||
@matcher = self.class.have_attached_file(:avatar)
|
||||
@matcher = self.class.have_attached_file(:avatar)
|
||||
end
|
||||
|
||||
should "reject a class with no attachment" do
|
||||
@@ -13,7 +15,7 @@ class HaveAttachedFileMatcherTest < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
should "accept a class with an attachment" do
|
||||
modify_table("dummies"){|d| d.string :avatar_file_name }
|
||||
modify_table("dummies") { |d| d.string :avatar_file_name }
|
||||
@dummy_class.has_attached_file :avatar
|
||||
assert_accepts @matcher, @dummy_class
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user