Sha256: 7fb5643f456e0eae4cbe78b29a1356a5305058cf381408257f4034087f552543

Contents?: true

Size: 408 Bytes

Versions: 1

Compression:

Stored size: 408 Bytes

Contents

require 'helper'
require 'multi_json'

class ResponseApp
  include Newark

  get '/api' do
    { ok: true }
  end
end

class TestResponse < MiniTest::Unit::TestCase

  include Rack::Test::Methods

  def app
    ResponseApp.new
  end

  def test_json_api
    get '/api'
    assert_equal "{\"ok\":true}", last_response.body
    assert_equal 'application/json', last_response.headers['Content-Type']
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
newark-0.0.7 test/test_response.rb