-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
112 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
spec/dummy/test/controllers/dashboard/landings_controller_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
require "test_helper" | ||
|
||
class DashboardLandingsControllerTest < ActionDispatch::IntegrationTest | ||
def test_it_shows_a_landing_page | ||
get graphql_dashboard.root_path | ||
assert_includes response.body, "Welcome to the GraphQL-Ruby Dashboard" | ||
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 |
22 changes: 22 additions & 0 deletions
22
spec/dummy/test/controllers/dashboard/statics_controller_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
require "test_helper" | ||
|
||
class DashboardStaticsControllerTest < ActionDispatch::IntegrationTest | ||
def test_it_serves_assets | ||
get graphql_dashboard.static_path("dashboard.css") | ||
assert_includes response.body, "#header-icon {" | ||
assert_equal response.headers["Cache-Control"], "max-age=31556952, public" | ||
end | ||
|
||
def test_it_responds_404_for_others | ||
get graphql_dashboard.static_path("other.rb") | ||
assert_equal 404, response.status | ||
|
||
assert_raises ActionController::UrlGenerationError do | ||
graphql_dashboard.static_path("invalid~char.js") | ||
end | ||
|
||
get graphql_dashboard.static_path("invalid-char.js").sub("-char", "~char") | ||
assert_equal 404, response.status | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters