Skip to content

Commit

Permalink
Remove toggle for New Document controller to render always design sys…
Browse files Browse the repository at this point in the history
…tem layout.
  • Loading branch information
farahTW authored and minhngocd committed Nov 21, 2023
1 parent aa73222 commit e945d9e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
4 changes: 1 addition & 3 deletions app/controllers/admin/new_document_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
class Admin::NewDocumentController < Admin::BaseController
before_action :check_new_design_system_permissions, only: %i[index]

layout :get_layout
layout "design_system"

def index; end

Expand Down
20 changes: 0 additions & 20 deletions test/functional/admin/base_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,26 +147,6 @@ class Admin::BaseControllerTest < ActionController::TestCase
assert_not_current_item("/government/admin/organisations/my-test-org/features")
end

view_test "only renders non-organisation header links if not logged in" do
# It's not possible, at the moment, to show the new design system layout if no user is signed in,
# but once we remove the legacy layout, the design system will be the default layout. In order to
# test this for now we stub some BaseController methods—this stubbing won't be necessary once the
# design system transition has been completed.
Admin::BaseController.any_instance.stubs(:show_new_header?).returns(true)
Admin::BaseController.any_instance.stubs(:preview_design_system?).returns(true)
@controller = Admin::NewDocumentController.new

get :index

assert_select ".app-c-sub-navigation__list .app-c-sub-navigation__list-item a[href=\"/government/admin/organisations/my-test-org/features\"]", false
assert_select ".app-c-sub-navigation__list .app-c-sub-navigation__list-item a[href=\"/government/admin/organisations/my-test-org/corporate_information_pages\"]", false

assert_select ".app-c-sub-navigation__list .app-c-sub-navigation__list-item a[href=\"/government/admin/new-document\"]"
assert_select ".app-c-sub-navigation__list .app-c-sub-navigation__list-item a[href=\"/government/admin/editions\"]"
assert_select ".app-c-sub-navigation__list .app-c-sub-navigation__list-item a[href=\"/government/admin/statistics_announcements\"]"
assert_select ".app-c-sub-navigation__list .app-c-sub-navigation__list-item a[href=\"/government/admin/more\"]"
end

private

def assert_not_current_item(path)
Expand Down

0 comments on commit e945d9e

Please sign in to comment.