Sha256: fc37eb5999976c1fd81c476af797024f0971cf081f2f1f027a6e6d60c7ec7d8b

Contents?: true

Size: 685 Bytes

Versions: 14

Compression:

Stored size: 685 Bytes

Contents

require "spec_helper"

describe "Metaclasses" do
  context "A meta-class of dummy" do
    if active_support_version >= "4.1" || ruby_version < "2.1"
      before do
        rebuild_model
        reset_class("Dummy")
      end

      it "is able to use Paperclip like a normal class" do
        @dummy = Dummy.new

        assert_nothing_raised do
          rebuild_meta_class_of(@dummy)
        end
      end

      it "works like any other instance" do
        @dummy = Dummy.new
        rebuild_meta_class_of(@dummy)

        assert_nothing_raised do
          @dummy.avatar = File.new(fixture_file("5k.png"), "rb")
        end
        assert @dummy.save
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kt-paperclip-7.2.2 spec/paperclip/meta_class_spec.rb
kt-paperclip-7.2.1 spec/paperclip/meta_class_spec.rb
kt-paperclip-7.2.0 spec/paperclip/meta_class_spec.rb
kt-paperclip-6.4.2 spec/paperclip/meta_class_spec.rb
kt-paperclip-7.1.1 spec/paperclip/meta_class_spec.rb
kt-paperclip-7.1.0 spec/paperclip/meta_class_spec.rb
kt-paperclip-7.0.1 spec/paperclip/meta_class_spec.rb
kt-paperclip-7.0.0 spec/paperclip/meta_class_spec.rb
kt-paperclip-6.4.1 spec/paperclip/meta_class_spec.rb
kt-paperclip-6.4.0 spec/paperclip/meta_class_spec.rb
kt-paperclip-6.3.0 spec/paperclip/meta_class_spec.rb
kt-paperclip-6.2.2 spec/paperclip/meta_class_spec.rb
kt-paperclip-6.2.1 spec/paperclip/meta_class_spec.rb
kt-paperclip-6.2.0 spec/paperclip/meta_class_spec.rb