File: landings_controller_test.rb

package info (click to toggle)
ruby-graphql 2.5.19-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,868 kB
  • sloc: ruby: 80,420; ansic: 1,808; yacc: 845; javascript: 480; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true
require "test_helper"

class DashboardLandingsControllerTest < ActionDispatch::IntegrationTest
  def test_it_shows_a_landing_page_with_local_static_asset_links
    get graphql_dashboard.root_path
    assert_includes response.body, "Welcome to the GraphQL-Ruby Dashboard"
    assert_includes response.body, '<link rel="stylesheet" href="/dash/statics/bootstrap-5.3.3.min.css" media="screen" />', "it doesn't use config.asset_host"
  end

  def test_it_shows_version_and_schema_info
    get graphql_dashboard.root_path
    assert_includes response.body, "GraphQL-Ruby v#{GraphQL::VERSION}"
    assert_includes response.body, "<code>DummySchema</code>"
    get graphql_dashboard.root_path, params: { schema: "NotInstalledSchema" }
    assert_includes response.body, "<code>NotInstalledSchema</code>"
  end
end