Sha256: 21950b66a375aaeecfd5c6be29e615ab7601d47929206252f533a6175c1a7a3c

Contents?: true

Size: 520 Bytes

Versions: 114

Compression:

Stored size: 520 Bytes

Contents

require 'test_helper'

class TestFlyer < ::Test::Unit::TestCase


  def test_create_flyer
    flyer = MLS::Flyer.create(:file => File.new('test/fixtures/flyer.pdf'))
    assert flyer.id
  end
  
  def test_attach_flyer_to_listing
    listing = MLS::Listing.create
    flyer = MLS::Flyer.create(
      :file => File.new('test/fixtures/flyer.pdf'),
      :subject => listing)
    
    flyer = MLS::Flyer.find(flyer.id)
    assert_equal listing.id, flyer.subject_id
    assert_equal "Listing", flyer.subject_type
  end

end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
mls-1.1.3 test/units/models/test_flyer.rb
mls-1.1.2 test/units/models/test_flyer.rb
mls-1.1.1 test/units/models/test_flyer.rb
mls-1.1.0 test/units/models/test_flyer.rb
mls-1.0.0 test/units/models/test_flyer.rb
mls-0.14.0 test/units/models/test_flyer.rb
mls-0.13.0 test/units/models/test_flyer.rb
mls-0.12.5 test/units/models/test_flyer.rb
mls-0.12.4 test/units/models/test_flyer.rb
mls-0.12.2 test/units/models/test_flyer.rb
mls-0.12.3 test/units/models/test_flyer.rb
mls-0.12.1 test/units/models/test_flyer.rb
mls-0.11.3 test/units/models/test_flyer.rb
mls-0.11.2 test/units/models/test_flyer.rb
mls-0.11.1 test/units/models/test_flyer.rb
mls-0.11.0 test/units/models/test_flyer.rb
mls-0.9.9 test/units/models/test_flyer.rb
mls-0.9.8 test/units/models/test_flyer.rb
mls-0.9.6 test/units/models/test_flyer.rb
mls-0.9.5 test/units/models/test_flyer.rb