Sha256: ed28830d7269e40c91205339af5458c138b5ef2181d9a5bb6813939a3854a994

Contents?: true

Size: 757 Bytes

Versions: 32

Compression:

Stored size: 757 Bytes

Contents

# encoding: utf-8

require File.dirname(__FILE__) + '/../spec_helper'

describe CarrierWave::Uploader do

  before do
    @uploader_class = Class.new(CarrierWave::Uploader::Base)
    @uploader = @uploader_class.new
  end
  
  after do
    FileUtils.rm_rf(public_path)
  end

  describe '#model' do
    it "should be remembered from initialization" do
      model = mock('a model object')
      @uploader = @uploader_class.new(model)
      @uploader.model.should == model
    end
  end

  describe '#mounted_as' do
    it "should be remembered from initialization" do
      model = mock('a model object')
      @uploader = @uploader_class.new(model, :llama)
      @uploader.model.should == model
      @uploader.mounted_as.should == :llama
    end
  end

end

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
andrewtimberlake-carrierwave-0.3.2.1 spec/uploader/mountable_spec.rb
durran-carrierwave-0.3.2.3 spec/uploader/mountable_spec.rb
jnicklas-carrierwave-0.3.2.1 spec/uploader/mountable_spec.rb
jnicklas-carrierwave-0.3.2 spec/uploader/mountable_spec.rb
jnicklas-carrierwave-0.3.3 spec/uploader/mountable_spec.rb
thorsson_carrierwave-0.4.12 spec/uploader/mountable_spec.rb
thorsson_carrierwave-0.4.11 spec/uploader/mountable_spec.rb
thorsson_carrierwave-0.4.10 spec/uploader/mountable_spec.rb
thorsson_carrierwave-0.4.9 spec/uploader/mountable_spec.rb
thorsson_carrierwave-0.4.8 spec/uploader/mountable_spec.rb
thorsson_carrierwave-0.4.6 spec/uploader/mountable_spec.rb
thorsson_carrierwave-0.4.5 spec/uploader/mountable_spec.rb
carrierwave-rails3-0.4.5 spec/uploader/mountable_spec.rb
samlown-carrierwave-0.4.5 spec/uploader/mountable_spec.rb
dsturnbull-carrierwave-0.4.9 spec/uploader/mountable_spec.rb
dsturnbull-carrierwave-0.4.8 spec/uploader/mountable_spec.rb
dsturnbull-carrierwave-0.4.7 spec/uploader/mountable_spec.rb
carrierwave-0.4.5 spec/uploader/mountable_spec.rb
dsturnbull-carrierwave-0.4.6 spec/uploader/mountable_spec.rb
dsturnbull-carrierwave-0.4.5 spec/uploader/mountable_spec.rb