Sha256: 0bdb70bf874a742eba85c0da30092324fa43802956d2c9bf690dad1e16c9e3a6

Contents?: true

Size: 655 Bytes

Versions: 2

Compression:

Stored size: 655 Bytes

Contents

require_relative 'helper'

class SuccessTest < ApiTest
  class App < Jersey::API::Base
    get '/test-201' do
      created({foo: 'baz'})
    end

    get '/test-202' do
      accepted({foo: 'bar'})
    end

    get '/test-204' do
      no_content
    end
  end

  def test_created
    get '/test-201'
    assert_equal(201, last_response.status)
    assert_equal('baz', json['foo'])
  end

  def test_accepted
    get '/test-202'
    assert_equal(202, last_response.status)
    assert_equal('bar', json['foo'])
  end

  def test_no_content
    get '/test-204'
    assert_equal(204, last_response.status)
    assert_equal('', last_response.body)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jersey-0.2.0 test/success_test.rb
jersey-0.1.0 test/success_test.rb