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-0.2.36 test/units/models/test_flyer.rb
mls-0.2.35 test/units/models/test_flyer.rb
mls-0.2.34 test/units/models/test_flyer.rb
mls-0.2.33 test/units/models/test_flyer.rb
mls-0.2.32 test/units/models/test_flyer.rb
mls-0.2.31 test/units/models/test_flyer.rb
mls-0.2.29 test/units/models/test_flyer.rb
mls-0.2.28 test/units/models/test_flyer.rb
mls-0.2.26 test/units/models/test_flyer.rb
mls-0.2.25 test/units/models/test_flyer.rb
mls-0.2.24 test/units/models/test_flyer.rb
mls-0.2.23 test/units/models/test_flyer.rb
mls-0.2.21 test/units/models/test_flyer.rb
mls-0.2.20 test/units/models/test_flyer.rb
mls-0.2.19 test/units/models/test_flyer.rb
mls-0.2.18 test/units/models/test_flyer.rb
mls-0.2.17 test/units/models/test_flyer.rb
mls-0.2.16 test/units/models/test_flyer.rb
mls-0.2.15 test/units/models/test_flyer.rb
mls-0.2.14 test/units/models/test_flyer.rb