-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic smoke tests to verify cms admin pages are being rendered
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# frozen_string_literal: true | ||
|
||
require "test_helper" | ||
|
||
class CmsAdminTest < ActionDispatch::IntegrationTest | ||
test "/admin url" do | ||
get comfy_admin_cms_path, | ||
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)} | ||
|
||
assert_response :redirect | ||
assert_redirected_to comfy_admin_cms_site_pages_path(site_id: Comfy::Cms::Site.first) | ||
end | ||
|
||
test "admin site" do | ||
get comfy_admin_cms_sites_path, | ||
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)} | ||
|
||
assert_response :success | ||
assert_select "h2", "Sites" | ||
end | ||
|
||
test "admin site pages" do | ||
get comfy_admin_cms_site_pages_path(site_id: Comfy::Cms::Site.first), | ||
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)} | ||
|
||
assert_response :success | ||
assert_select "h2", "Pages" | ||
end | ||
|
||
test "admin site layouts" do | ||
get comfy_admin_cms_site_layouts_path(site_id: Comfy::Cms::Site.first), | ||
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)} | ||
|
||
assert_response :success | ||
assert_select "h2", "Layouts" | ||
end | ||
|
||
test "admin site snippets" do | ||
get comfy_admin_cms_site_snippets_path(site_id: Comfy::Cms::Site.first), | ||
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)} | ||
|
||
assert_response :success | ||
assert_select "h2", "Snippets" | ||
end | ||
|
||
test "admin site files" do | ||
get comfy_admin_cms_site_files_path(site_id: Comfy::Cms::Site.first), | ||
headers: {Authorization: ActionController::HttpAuthentication::Basic.encode_credentials(Rails.application.secrets.cms_user, Rails.application.secrets.cms_password)} | ||
|
||
assert_response :success | ||
assert_select "h2", "Files" | ||
end | ||
end |