diff --git a/apps/dashboard/test/integration/custom_pages_integration_test.rb b/apps/dashboard/test/integration/custom_pages_integration_test.rb index 668cb609a..b2dd9e9df 100644 --- a/apps/dashboard/test/integration/custom_pages_integration_test.rb +++ b/apps/dashboard/test/integration/custom_pages_integration_test.rb @@ -1,42 +1,43 @@ +# frozen_string_literal: true + require 'test_helper' class CustomPagesIntegrationTest < ActionDispatch::IntegrationTest - - test "should render configured page layout" do + test 'should render configured page layout' do stub_user_configuration({ - custom_pages: { - docs: { - rows: [ - {columns: [ - { - widgets: 'custom_pages_test' - } - ]}, - {columns: [ - { - width: 8, - widgets: 'custom_pages_test' - } - ]} - ] - } - } - }) - - get custom_pages_path(page_code: "docs") + custom_pages: { + docs: { + rows: [ + { columns: [ + { + widgets: 'custom_pages_test' + } + ] }, + { columns: [ + { + width: 8, + widgets: 'custom_pages_test' + } + ] } + ] + } + } + }) + + get custom_pages_path(page_code: 'docs') assert :success assert_select 'div.row', 2 assert_select 'div.row > div.col-md-12', 1 - assert_select 'div.row > div.col-md-12 > h3', text: "Custom Pages Test Widget" + assert_select 'div.row > div.col-md-12 > h3', text: 'Custom Pages Test Widget' assert_select 'div.row > div.col-md-8', 1 - assert_select 'div.row > div.col-md-8 > h3', text: "Custom Pages Test Widget" + assert_select 'div.row > div.col-md-8 > h3', text: 'Custom Pages Test Widget' end - test "should render error message when page is not found" do - stub_user_configuration({custom_pages: {}}) + test 'should render error message when page is not found' do + stub_user_configuration({ custom_pages: {} }) - get custom_pages_path(page_code: "not_defined") + get custom_pages_path(page_code: 'not_defined') assert :success # There should be 3 alert-danger divs @@ -45,9 +46,7 @@ class CustomPagesIntegrationTest < ActionDispatch::IntegrationTest # custom page not found assert_select "div.alert-danger[role='alert']", 3 assert_select "div.alert-danger[role='alert']" do |elements| - assert_match /Invalid page code: not_defined/, elements[2].text + assert_match(/Invalid page code: not_defined/, elements[2].text) end end - - -end \ No newline at end of file +end