5
5
require File . expand_path ( '../../config/environment' , __FILE__ )
6
6
require 'rails/test_help'
7
7
require 'capybara/rails'
8
- require 'slimmer/test_helpers/govuk_components'
9
8
require 'mocha/mini_test'
10
9
require 'faker'
11
10
@@ -23,11 +22,6 @@ def teardown
23
22
24
23
class ActiveSupport ::TestCase
25
24
include GovukContentSchemaExamples
26
- include Slimmer ::TestHelpers ::GovukComponents
27
-
28
- def setup
29
- stub_shared_component_locales
30
- end
31
25
end
32
26
33
27
# Note: This is so that slimmer is skipped, preventing network requests for
@@ -43,37 +37,8 @@ def set_skip_slimmer_header
43
37
class ActionDispatch ::IntegrationTest
44
38
# Make the Capybara DSL available in all integration tests
45
39
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
61
40
62
41
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
77
42
assert page . has_content? ( label )
78
43
assert page . has_content? ( value )
79
44
end
0 commit comments