Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove alpha and beta label processors #111

Merged
merged 1 commit into from
Jan 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/slimmer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ module Slimmer
autoload :ComponentResolver, 'slimmer/component_resolver'

module Processors
autoload :AlphaLabelInserter, 'slimmer/processors/alpha_label_inserter'
autoload :BetaNoticeInserter, 'slimmer/processors/beta_notice_inserter'
autoload :BetaLabelInserter, 'slimmer/processors/beta_label_inserter'
autoload :BodyClassCopier, 'slimmer/processors/body_class_copier'
autoload :BodyInserter, 'slimmer/processors/body_inserter'
autoload :ConditionalCommentMover, 'slimmer/processors/conditional_comment_mover'
Expand Down
6 changes: 0 additions & 6 deletions lib/slimmer/headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ module Headers
HEADER_PREFIX = "X-Slimmer"

SLIMMER_HEADER_MAPPING = {
alpha_label: "Alpha-Label",
application_name: "Application-Name",
beta: "Beta",
beta_label: "Beta-Label",
format: "Format",
page_owner: "Page-Owner",
proposition: "Proposition",
Expand All @@ -23,11 +20,8 @@ module Headers
template: "Template",
}

ALPHA_LABEL = "#{HEADER_PREFIX}-#{SLIMMER_HEADER_MAPPING[:alpha_label]}"
APPLICATION_NAME_HEADER = "#{HEADER_PREFIX}-#{SLIMMER_HEADER_MAPPING[:application_name]}"
ARTEFACT_HEADER = "#{HEADER_PREFIX}-Artefact"
BETA_HEADER = "#{HEADER_PREFIX}-#{SLIMMER_HEADER_MAPPING[:beta]}"
BETA_LABEL = "#{HEADER_PREFIX}-#{SLIMMER_HEADER_MAPPING[:beta_label]}"
FORMAT_HEADER = "#{HEADER_PREFIX}-#{SLIMMER_HEADER_MAPPING[:format]}"
ORGANISATIONS_HEADER = "#{HEADER_PREFIX}-#{SLIMMER_HEADER_MAPPING[:organisations]}"
REPORT_A_PROBLEM_FORM = "#{HEADER_PREFIX}-#{SLIMMER_HEADER_MAPPING[:report_a_problem]}"
Expand Down
35 changes: 0 additions & 35 deletions lib/slimmer/processors/alpha_label_inserter.rb

This file was deleted.

35 changes: 0 additions & 35 deletions lib/slimmer/processors/beta_label_inserter.rb

This file was deleted.

35 changes: 0 additions & 35 deletions lib/slimmer/processors/beta_notice_inserter.rb

This file was deleted.

3 changes: 0 additions & 3 deletions lib/slimmer/skin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ def success(source_request, response, body)
response.headers,
wrapper_id),
Processors::MetaViewportRemover.new(self, response.headers),
Processors::BetaNoticeInserter.new(self, response.headers),
Processors::BetaLabelInserter.new(self, response.headers),
Processors::AlphaLabelInserter.new(self, response.headers),
]

template_name = response.headers[Headers::TEMPLATE_HEADER] || 'wrapper'
Expand Down
1 change: 0 additions & 1 deletion lib/slimmer/test_templates/alpha_label.html

This file was deleted.

1 change: 0 additions & 1 deletion lib/slimmer/test_templates/beta_label.html

This file was deleted.

1 change: 0 additions & 1 deletion lib/slimmer/test_templates/beta_notice.html

This file was deleted.

25 changes: 0 additions & 25 deletions test/deprecated_usage_test.rb

This file was deleted.

1 change: 0 additions & 1 deletion test/fixtures/alpha_label.html.erb

This file was deleted.

1 change: 0 additions & 1 deletion test/fixtures/beta_label.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions test/fixtures/beta_notice.html.erb

This file was deleted.

42 changes: 0 additions & 42 deletions test/processors/alpha_label_inserter_test.rb

This file was deleted.

42 changes: 0 additions & 42 deletions test/processors/beta_label_inserter_test.rb

This file was deleted.

3 changes: 0 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ def given_response(code, body, headers={}, app_options={})
use_template(template_name)
use_template('related.raw')
use_template('report_a_problem.raw')
use_template('alpha_label')
use_template('beta_notice')
use_template('beta_label')

fetch_page
end
Expand Down
33 changes: 0 additions & 33 deletions test/typical_usage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ def test_should_copy_the_class_of_the_body_element
def test_should_insert_section_links_into_the_navigation
assert_rendered_in_template "#global-breadcrumb ol li a[href='https://www.test.gov.uk/browse/this-section']", "This section"
end

def test_should_not_add_beta_notice_to_non_beta_pages
assert_no_selector "body.beta"
assert_no_selector ".beta-notice"
end
end

class ConditionalCommentTest < SlimmerIntegrationTest
Expand Down Expand Up @@ -250,34 +245,6 @@ def test_should_add_the_current_url_to_the_form
end
end

class BetaLabelInserterTest < SlimmerIntegrationTest
def test_should_add_beta_label
given_response 200, %{
<html>
<body class="wibble">
<div id="wrapper">The body of the page</div>
</body>
</html>
}, { Slimmer::Headers::BETA_LABEL => 'after:#wrapper' }

assert_rendered_in_template '.beta-label'
end
end

class AlphaLabelInserterTest < SlimmerIntegrationTest
def test_should_add_alpha_label
given_response 200, %{
<html>
<body class="wibble">
<div id="wrapper">The body of the page</div>
</body>
</html>
}, { Slimmer::Headers::ALPHA_LABEL => 'after:#wrapper' }

assert_rendered_in_template '.alpha-label'
end
end

class Error500ResponseTest < SlimmerIntegrationTest
given_response 500, %{
<html>
Expand Down