Sha256: 98bbad25cabd390e3f2aaf9bfcc5c99015cb618fcf9d1ea9577346c2cb44a8c9

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

require 'spec_helper'

describe ImportableAttachments::Version do
  # :call-seq:
  # mock_version [:opts]
  #
  # yields a mock Version object

  def mock_version(opts = {})
    lopts = {:id => 27, :item_type => nil, :item_id => nil}
    @version = mock_model(Version, lopts.merge(opts))
    @version
  end

  before :each do
    mock_version
  end

  context 'validations' do
    it { should have_valid(:item_id).when(nil, 1, 'uniqueId', 'unique_id', 'unique.id') }

    it { should have_valid(:item_type).when(nil, 'Attachment', 'ImportableAttachments::Attachment') }
    it { should_not have_valid(:item_type).when("Test \x0 data") }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
importable_attachments-0.0.18 spec/models/importable_attachments/version_spec.rb
importable_attachments-0.0.17 spec/models/importable_attachments/version_spec.rb
importable_attachments-0.0.15 spec/models/importable_attachments/version_spec.rb
importable_attachments-0.0.14 spec/models/importable_attachments/version_spec.rb
importable_attachments-0.0.13 spec/models/importable_attachments/version_spec.rb