Sha256: 262d782329e63752a5739fd8d4660b6e40528296164da330179330edf33d24e6

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

require 'spec_helper'
require 'ostruct'
require 'backgrounder/orm/activemodel'

describe CarrierWave::Backgrounder::ORM::ActiveModel do
  before do
    @mock_class = Class.new do
      def self.before_save(method, opts); nil; end
      def self.after_commit(method, opts); nil; end
      def avatar_changed?; nil;  end
      def remote_avatar_url; OpenStruct.new(:present? => true); end
      def previous_changes; {}; end
    end

    @mock_class.extend CarrierWave::Backgrounder::ORM::ActiveModel
    @mock_class.process_in_background :avatar
  end

  describe '#trigger_column_background_processing?' do
    it "calls up to processs column upload getter in the base class" do
      instance = @mock_class.new
      instance.expects(:process_avatar_upload)
      instance.trigger_avatar_background_processing?
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
carrierwave_backgrounder-0.1.2 spec/backgrounder/orm/activemodel_spec.rb
carrierwave_backgrounder-0.1.1 spec/backgrounder/orm/activemodel_spec.rb
carrierwave_backgrounder-0.1.0 spec/backgrounder/orm/activemodel_spec.rb
carrierwave_backgrounder-0.0.9 spec/backgrounder/orm/activemodel_spec.rb