Skip to content

JSON and Testing #97

@lucianolorenti

Description

@lucianolorenti

Hi! How are you?
I am facing the following issue. Suppouse that you have and enpoint that returns a JSON

using Bukdu
struct WelcomeController <: ApplicationController
    conn::Conn
end
index(c::WelcomeController) = render(JSON, Dict("something"=>[:hello_world, :goodbye_world]))
routes() do
    get("/", WelcomeController, index)
end
Bukdu.start(8080)

If I made a call from a browser to "/" I got:

{"something":["hello_world","goodbye_world"]}

But when I made a test case and I call the endpoing from julia doing:
julia> response = Bukdu.Router.call(get, "/")

I got:

julia> response.got
Dict{String,Array{Symbol,1}} with 1 entry:
  "something" => Symbol[:hello_world, :goodbye_world]

Is this an expected behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions