Skip to content

Commit

Permalink
Use document_type as the arg for get_linkables.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotcm committed Mar 4, 2016
1 parent 1cd9221 commit 4db0253
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem 'govuk_admin_template', '~> 3.5'
gem 'generic_form_builder', '0.13.0'
gem 'selectize-rails', '~> 0.12.1'

gem 'gds-api-adapters', '~> 29.1'
gem 'gds-api-adapters', '~> 29.3'

gem 'govspeak','3.3.0'

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ GEM
railties (>= 3.0.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
gds-api-adapters (29.1.1)
gds-api-adapters (29.3.1)
link_header
lrucache (~> 0.1.1)
null_logger
Expand Down Expand Up @@ -306,7 +306,7 @@ DEPENDENCIES
cucumber-rails
database_cleaner
factory_girl_rails
gds-api-adapters (~> 29.1)
gds-api-adapters (~> 29.3)
gds-sso (~> 11.2)
generic_form_builder (= 0.13.0)
govspeak (= 3.3.0)
Expand Down
6 changes: 3 additions & 3 deletions lib/content_item_fetcher.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Content items from the publishing-api
class ContentItemFetcher
def organisations
@organisations ||= Services.publishing_api.get_linkables(format: 'organisation')
@organisations ||= Services.publishing_api.get_linkables(document_type: 'organisation')
end

def people
@people ||= Services.publishing_api.get_linkables(format: 'person')
@people ||= Services.publishing_api.get_linkables(document_type: 'person')
end

def working_groups
@working_groups ||= Services.publishing_api.get_linkables(format: 'working_group')
@working_groups ||= Services.publishing_api.get_linkables(document_type: 'working_group')
end

def find_person(content_id)
Expand Down
8 changes: 3 additions & 5 deletions spec/lib/policy_actions/search_indexer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@

before do
stub_any_rummager_post

fields = %w(content_id format title base_path)
publishing_api_has_linkables(organisations, format: "organisation")
publishing_api_has_linkables(people, format: "person")
publishing_api_has_linkables(working_groups, format: "working_group")
publishing_api_has_linkables(organisations, document_type: "organisation")
publishing_api_has_linkables(people, document_type: "person")
publishing_api_has_linkables(working_groups, document_type: "working_group")
end

let(:organisations) do
Expand Down
9 changes: 4 additions & 5 deletions spec/support/publishing_api_content_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ def stub_post_to_search
end

def stub_content_calls_from_publishing_api
fields = %w(content_id format title base_path)
publishing_api_has_linkables([lead_organisation_1, lead_organisation_2], format: "lead_organisation")
publishing_api_has_linkables([organisation_1, organisation_2], format: "organisation")
publishing_api_has_linkables([person_1, person_2], format: "person")
publishing_api_has_linkables([working_group_1, working_group_2], format: "working_group")
publishing_api_has_linkables([lead_organisation_1, lead_organisation_2], document_type: "lead_organisation")
publishing_api_has_linkables([organisation_1, organisation_2], document_type: "organisation")
publishing_api_has_linkables([person_1, person_2], document_type: "person")
publishing_api_has_linkables([working_group_1, working_group_2], document_type: "working_group")
end

def lead_organisation_1
Expand Down

0 comments on commit 4db0253

Please sign in to comment.