Sha256: ac6fde1fe5214171d85b817a0af79c9b0c91e8c0540b9549f798b2e4ad6c56cd

Contents?: true

Size: 1.7 KB

Versions: 16

Compression:

Stored size: 1.7 KB

Contents

require 'helper'

class TestStatusClient < Test::Unit::TestCase

  should "get status for posting with BD9FHQC postKey" do
    posting_client = PostingClient.new
    existing_postings = posting_client.get_posting("BD9FHQC")
    client = StatusClient.new
    response = client.get_status(existing_postings)
    assert_equal Array, response.class
  end

  should "test update status" do
    posting_client = PostingClient.new
    status_client = StatusClient.new
    posting = posting_client.get_posting("BD9FHQC")
    error = Message.from_hash(:code => 666, :message => "UFO posting error")
    posting.status.errors << error
    posting.status.attributes = {:postKey => "TESTKEY", :message => "UFO test message"}
    posting.status.event = 'lost'
    assert_equal String, posting.status.to_params.class
    update_response = status_client.update_status(posting)
    assert_equal Message , update_response.class
    assert_equal 200 , update_response.code
  end

  should "test get status" do
    search_request = SearchRequest.new
    search_request.category = 'VAUT'
    search_request.annotations = {:Make => "porsche"}
    search_request.rpp = 2
    search_request.page = 4
    search_request.retvals = ["category", "location", "heading", "externalURL", "timestamp", "postKey", "source", "image", "externalID"]

    client = SearchClient.new
    search_response = client.search(search_request)
    existing_postings = search_response.results
    client = StatusClient.new
    response = client.get_status(existing_postings)
    assert_equal Array, response.class
  end
  
  should "test system status" do
    client = StatusClient.new
    status_response = client.system_status
    assert_equal Message, status_response.class
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

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