Skip to content

Commit

Permalink
rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarwyatt committed Aug 14, 2018
1 parent 2246cbf commit b549356
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/services/most_popular_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class MostPopularContent
include RummagerFields

attr_reader :content_ids, :current_path, :filters, :number_of_links
def initialize(content_ids:, current_path:, filter_content_purpose_supergroup:, number_of_links: 3)

def initialize(content_ids:, current_path:, filters: {}, number_of_links: 3)
@content_ids = content_ids
@current_path = current_path
@filters = filters
Expand Down
2 changes: 1 addition & 1 deletion app/services/most_recent_content.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class MostRecentContent
attr_reader :content_id, :current_path, :filters, :number_of_links

def initialize(content_ids:, current_path:, filter_content_purpose_supergroup:, number_of_links: 3)
def initialize(content_ids:, current_path:, filters: {}, number_of_links: 3)
@content_ids = content_ids
@current_path = current_path
@filters = filters
Expand Down
10 changes: 5 additions & 5 deletions test/integration/content_pages_navigation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def setup
assert page.has_css?('.gem-c-highlight-boxes__title[data-track-category="ServicesHighlightBoxClicked"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-highlight-boxes__title[data-track-action="1"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-highlight-boxes__title[data-track-label="/government/publications/meals"]', text: 'Free school meals form')
assert_has_services_section
end

test "does not show the Services section if there is no tagged content" do
Expand All @@ -122,7 +121,11 @@ def setup

setup_and_visit_content_item_with_taxons('guide', taxons)

assert_has_policy_and_engagement_section
assert page.has_css?('h3', text: "Policy and engagement")

assert page.has_css?('.gem-c-document-list__item a[data-track-category="policyAndEngagementDocumentListClicked"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-document-list__item a[data-track-action="1"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-document-list__item a[data-track-label="/government/publications/meals"]', text: 'Free school meals form')
end

test "does not show the Policy section if there is no tagged content" do
Expand Down Expand Up @@ -200,15 +203,12 @@ def setup

setup_and_visit_content_item_with_taxons('guide', taxons)

<<<<<<< HEAD
assert page.has_css?('h3', text: "News and communications")
assert page.has_css?('.gem-c-image-card__title', text: 'Free school meals form')
assert page.has_css?('.gem-c-image-card__title-link[data-track-category="newsAndCommunicationsImageCardClicked"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-image-card__title-link[data-track-action="1"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-image-card__title-link[data-track-label="/government/publications/meals"]', text: 'Free school meals form')
=======
assert_has_news_and_communications_section
>>>>>>> Add links out to configure taxonomy navigation
end

test "does not show the News and comms section if there is no tagged content" do
Expand Down
4 changes: 0 additions & 4 deletions test/support/content_pages_nav_test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ def assert_has_services_section
assert page.has_css?('.gem-c-highlight-boxes__title[data-track-category="ServicesHighlightBoxClicked"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-highlight-boxes__title[data-track-action="1"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-highlight-boxes__title[data-track-label="/government/publications/meals"]', text: 'Free school meals form')

assert page.has_css?('.gem-c-document-list__item a[data-track-category="ServicesDocumentListClicked"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-document-list__item a[data-track-action="1"]', text: 'Free school meals form')
assert page.has_css?('.gem-c-document-list__item a[data-track-label="/government/publications/meals"]', text: 'Free school meals form')
end

def assert_has_policy_and_engagement_section
Expand Down

0 comments on commit b549356

Please sign in to comment.