-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5eaf1a1
commit 70dd2b9
Showing
7 changed files
with
44 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module EducationNavigationABTestable | ||
def education_navigation_ab_test | ||
@ab_test ||= GovukAbTesting::AbTest.new("educationnavigation") | ||
end | ||
|
||
def should_present_new_navigation_view? | ||
education_navigation_variant.variant_b? && new_navigation_enabled? && content_is_tagged_to_a_taxon? | ||
end | ||
|
||
def education_navigation_variant | ||
@education_navigation_variant ||= education_navigation_ab_test.requested_variant request | ||
end | ||
|
||
def new_navigation_enabled? | ||
ENV['ENABLE_NEW_NAVIGATION'] == 'yes' | ||
end | ||
|
||
def content_is_tagged_to_a_taxon? | ||
content_item.content_item.dig("links", "taxons").present? | ||
end | ||
|
||
def set_education_navigation_response_header | ||
education_navigation_variant.configure_response response | ||
end | ||
|
||
def self.included(base) | ||
base.helper_method :education_navigation_variant | ||
base.after_filter :set_education_navigation_response_header | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters