Skip to content

Commit

Permalink
Always use the non-numbered contents list
Browse files Browse the repository at this point in the history
This removes the `GuideChapterNav` A/B test. We've tested this and
we'll keep the B version.

https://trello.com/c/ndUiAA1y
  • Loading branch information
tijmenb committed Mar 28, 2018
1 parent c0c674f commit 741d5d5
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 191 deletions.
68 changes: 0 additions & 68 deletions app/controllers/concerns/guide_nav_ab_testable.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/controllers/content_items_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class ContentItemsController < ApplicationController
include GuideNavAbTestable

rescue_from GdsApi::HTTPForbidden, with: :error_403
rescue_from GdsApi::HTTPNotFound, with: :error_notfound
rescue_from GdsApi::HTTPGone, with: :error_410
Expand Down
4 changes: 0 additions & 4 deletions app/presenters/guide_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ def multi_page_guide?
parts.size > 1
end

def current_part_title_with_index
"#{current_part_index + 1}. #{current_part_title}"
end

def print_link
"#{base_path}/print"
end
Expand Down
6 changes: 1 addition & 5 deletions app/views/content_items/guide.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
<% if @content_item.has_parts? %>
<% if @content_item.multi_page_guide? %>
<h1 class="part-title">
<% if show_alternate_guide_chapters? %>
<%= @content_item.current_part_title %>
<% else %>
<%= @content_item.current_part_title_with_index %>
<% end %>
<%= @content_item.current_part_title %>
</h1>
<% end %>
<%= render 'govuk_component/govspeak',
Expand Down
21 changes: 1 addition & 20 deletions app/views/shared/_parts_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
<% if show_alternate_guide_chapters? %>
<%= render "components/contents-list", aria_label: navigation_label, contents: content_item.part_link_elements %>
<% else %>
<nav role="navigation" class="grid-row part-navigation" aria-label="<%= navigation_label %>" data-module="track-click">
<% content_item.parts_navigation.each_with_index do |part_group, i| %>
<ol
class="column-half"
<% if i == 1 %>
start="<%= content_item.parts_navigation_second_list_start %>"
<% end %>
>
<% part_group.each do |part_nav_item| %>
<li>
<%= part_nav_item %>
</li>
<% end %>
</ol>
<% end %>
</nav>
<% end %>
<%= render "components/contents-list", aria_label: navigation_label, contents: content_item.part_link_elements %>
1 change: 0 additions & 1 deletion test/controllers/content_items_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class ContentItemsControllerTest < ActionController::TestCase
include GdsApi::TestHelpers::ContentStore
include GdsApi::TestHelpers::Rummager
include GovukAbTesting::MinitestHelpers

test 'routing handles paths with no format or locale' do
assert_routing(
Expand Down
81 changes: 0 additions & 81 deletions test/controllers/guide_chapter_nav_ab_test_controller_test.rb

This file was deleted.

1 change: 0 additions & 1 deletion test/controllers/step_navigation_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

class ContentItemsControllerTest < ActionController::TestCase
include GdsApi::TestHelpers::ContentStore
include GovukAbTesting::MinitestHelpers

%w(guide answer publication).each do |schema_name|
test "#{schema_name} shows step by step navigation where relevant" do
Expand Down
5 changes: 0 additions & 5 deletions test/presenters/guide_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ def schema_name
end
end

test "presents part titles with their index" do
first_part_title = schema_item['details']['parts'].first['title']
assert_equal presented_item.current_part_title_with_index, "1. #{first_part_title}"
end

test 'presents withdrawn in the title for withdrawn content' do
presented_item = presented_item(schema_name, nil, "withdrawn_notice" => { "explanation": "Withdrawn", "withdrawn_at": "2014-08-22T10:29:02+01:00" })
assert_equal "[Withdrawn] The national curriculum", presented_item.page_title
Expand Down
4 changes: 0 additions & 4 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ def teardown
end
end

GovukAbTesting.configure do |config|
config.acceptance_test_framework = :active_support
end

class ActiveSupport::TestCase
include GovukContentSchemaExamples
include Slimmer::TestHelpers::GovukComponents
Expand Down

0 comments on commit 741d5d5

Please sign in to comment.