Sha256: 88001c5091b280edf26a0a78559801f305dda1038b4065383c9493fd5efff8ae

Contents?: true

Size: 712 Bytes

Versions: 1

Compression:

Stored size: 712 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))

class ToadHopper::TestPosting < Test::Unit::TestCase
  def test_posting
    toadhopper = ToadHopper("abc123")
    error = begin; raise "Kaboom!"; rescue => e; e end

    response = toadhopper.post!(error)
    assert_equal 422, response.status
    assert_equal ['No project exists with the given API key.'], response.errors
  end

  if ENV['HOPTOAD_API_KEY']
    def test_posting_integration
      toadhopper = ToadHopper(ENV['HOPTOAD_API_KEY'])
      error = begin; raise "Kaboom!"; rescue => e; e end

      response = toadhopper.post!(error)
      assert_equal 200, response.status
      assert_equal [], response.errors
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
toadhopper-0.9.4 test/test_posting.rb