mobilizon.chapril.org-mobil.../test/graphql/resolvers/config_test.exs

27 lines
653 B
Elixir
Raw Normal View History

2020-01-26 20:34:25 +01:00
defmodule Mobilizon.GraphQL.Resolvers.ConfigTest do
2019-03-22 10:53:38 +01:00
use MobilizonWeb.ConnCase
use Bamboo.Test
2020-01-26 20:34:25 +01:00
alias Mobilizon.GraphQL.AbsintheHelpers
2019-03-22 10:53:38 +01:00
describe "Resolver: Get config" do
test "get_config/3 returns the instance config", context do
query = """
{
config {
name,
registrationsOpen
}
}
"""
res =
context.conn
|> get("/api", AbsintheHelpers.query_skeleton(query, "config"))
assert json_response(res, 200)["data"]["config"]["name"] == "Test instance"
2019-03-22 10:53:38 +01:00
assert json_response(res, 200)["data"]["config"]["registrationsOpen"] == true
end
end
end