Sha256: 454c692ad3ff7f7b89ff4a2f47f582c2d81c609c711d269812f0f762f112dee9

Contents?: true

Size: 330 Bytes

Versions: 7

Compression:

Stored size: 330 Bytes

Contents

require_relative "../lib/tynn/json"

test "json" do
  Tynn.helpers(Tynn::JSON)

  Tynn.define do
    root do
      json(name: "tynn")
    end
  end

  app = Tynn::Test.new
  app.get("/")

  json = JSON.parse(app.res.body)

  assert_equal "tynn", json["name"]
  assert_equal "application/json", app.res.headers["Content-Type"]
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tynn-1.0.0 test/json_test.rb
tynn-1.0.0.rc3 test/json_test.rb
tynn-1.0.0.rc2 test/json_test.rb
tynn-1.0.0.rc1 test/json_test.rb
tynn-0.0.4 test/json_test.rb
tynn-0.0.3 test/json_test.rb
tynn-0.0.2 test/json.rb