Skip to content

Commit 2c18604

Browse files
committed
Remove support for Static-based components
"Wop wop" https://trello.com/c/pU7YINt1
1 parent 773ce62 commit 2c18604

File tree

3 files changed

+1
-38
lines changed

3 files changed

+1
-38
lines changed

app/controllers/application_controller.rb

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
class ApplicationController < ActionController::Base
2-
include Slimmer::GovukComponents
3-
42
# Prevent CSRF attacks by raising an exception.
53
# For APIs, you may want to use :null_session instead.
64
protect_from_forgery except: :service_sign_in_options

app/views/shared/_travel_advice_summary.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
direction: page_text_direction %>
1010
<% end %>
1111

12-
<%= render 'govuk_component/metadata', content_item.metadata %>
12+
<%= render 'govuk_publishing_components/components/metadata', content_item.metadata %>
1313
<% if content_item.map %>
1414
<figure class="map">
1515
<img src="<%= content_item.map["url"] %>" alt="<%= content_item.map["alt_text"] %>" class="map-image">

test/test_helper.rb

-35
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require File.expand_path('../../config/environment', __FILE__)
66
require 'rails/test_help'
77
require 'capybara/rails'
8-
require 'slimmer/test_helpers/govuk_components'
98
require 'mocha/mini_test'
109
require 'faker'
1110

@@ -23,11 +22,6 @@ def teardown
2322

2423
class ActiveSupport::TestCase
2524
include GovukContentSchemaExamples
26-
include Slimmer::TestHelpers::GovukComponents
27-
28-
def setup
29-
stub_shared_component_locales
30-
end
3125
end
3226

3327
# Note: This is so that slimmer is skipped, preventing network requests for
@@ -43,37 +37,8 @@ def set_skip_slimmer_header
4337
class ActionDispatch::IntegrationTest
4438
# Make the Capybara DSL available in all integration tests
4539
include Capybara::DSL
46-
include Slimmer::TestHelpers::GovukComponents
47-
48-
def setup
49-
stub_shared_component_locales
50-
end
51-
52-
def assert_no_component(name)
53-
assert page.has_no_css?(shared_component_selector(name)), "Found a component named #{name}"
54-
end
55-
56-
def assert_component_locals(name, locals)
57-
within shared_component_selector(name) do
58-
assert_equal locals, JSON.parse(page.text).deep_symbolize_keys
59-
end
60-
end
6140

6241
def assert_has_component_metadata_pair(label, value)
63-
end
64-
65-
def assert_has_component_document_footer_pair(label, value)
66-
assert_component_parameter("document_footer", label, value)
67-
end
68-
69-
def assert_component_parameter(component, label, value)
70-
within shared_component_selector(component) do
71-
# Flatten top level / "other" args, for consistent hash access
72-
component_args = JSON.parse(page.text).tap do |args|
73-
args.merge!(args.delete("other")) if args.key?("other")
74-
end
75-
assert_equal value, component_args.fetch(label)
76-
end
7742
assert page.has_content?(label)
7843
assert page.has_content?(value)
7944
end

0 commit comments

Comments
 (0)