Sha256: 5f1e9ef098b756df7af4b5fe7eaa51a3cf1b5e071b1ea0e19b840ab0c677c28e

Contents?: true

Size: 910 Bytes

Versions: 16

Compression:

Stored size: 910 Bytes

Contents

require 'helper'

class TestPosting < Test::Unit::TestCase
  should "create posting with empty images array" do
    posting = Posting.new
    assert_equal [], posting.images
    assert_equal({}, posting.annotations)
  end

  should "create posting with empty status attribute" do
    posting = Posting.new
    assert_equal StatusUpdateRequest, posting.status.class
    assert_equal String, posting.status.event.class
    assert_equal Hash, posting.status.attributes.class
    assert_equal Array, posting.status.errors.class
  end

  should "create posting with not empty images array" do
    posting = Posting.new(
      :images => ["image_path"],
      :history => ["old_posting"],
      :annotations => {'annotation' => "value"}
    )
    assert_equal ["image_path"], posting.images
    assert_equal ["old_posting"], posting.history
    assert_equal({'annotation' => "value"}, posting.annotations)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
threetaps-client-1.0.14 test/models/test_posting.rb
threetaps-client-1.0.13 test/models/test_posting.rb
threetaps-client-1.0.12 test/models/test_posting.rb
threetaps-client-1.0.11 test/models/test_posting.rb
threetaps-client-1.0.10 test/models/test_posting.rb
threetaps-client-1.0.9 test/models/test_posting.rb
threetaps-client-1.0.8 test/models/test_posting.rb
threetaps-client-1.0.7 test/models/test_posting.rb
threetaps-client-1.0.6 test/models/test_posting.rb
threetaps-client-1.0.5 test/models/test_posting.rb
threetaps-client-1.0.4 test/models/test_posting.rb
threetaps-client-1.0.3 test/models/test_posting.rb
threetaps-client-1.0.2 test/models/test_posting.rb
threetaps-client-1.0.1 test/models/test_posting.rb
threetaps-client-1.0.0 test/models/test_posting.rb
threetaps-client-0.5.1 test/models/test_posting.rb