Skip to content
Open
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
4 changes: 3 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ EDS_PASS=test
EDS_USE_CACHE=false
CATALOGUE_SEARCH_URL=http://test.host/catalog.json
FINDING_AIDS_SEARCH_URL=http://test.host/finding-aids/catalog.json
EBSCO_SEARCH_URL=https://search.ebscohost.com/login.aspx?authtype=ip,guest&groupid=main&profile=eds&direct=true

EBSCO_SEARCH_URL=https://research.ebsco.com/c/ciw6tp/search/results
EBSCO_PUB_FINDER_URL=https://publications.ebsco.com/c/elukgh

GLOBAL_MESSAGE_URL=http://test.nla.gov.au/catalogue-message/1234

Expand Down
8 changes: 4 additions & 4 deletions app/helpers/single_search_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ def bento_all_results_link(key)
bento_query = (params[:q] || params[:query])&.gsub("&", "%26")
link = if key.start_with?("ebsco_eds_keyword")
ebsco_link = if bento_query.present?
"#{ENV["EBSCO_SEARCH_URL"]}&custid=#{ENV["EDS_ORG"]}&bquery=#{bento_query}"
"#{ENV["EBSCO_SEARCH_URL"]}?q=#{bento_query}&limiters=FT1%3AY&searchMode=all&searchSegment=all-results"
else
"#{ENV["EBSCO_SEARCH_URL"]}&custid=#{ENV["EDS_ORG"]}"
ENV["EBSCO_SEARCH_URL"].to_s
end
ebsco_link
elsif key == "ebsco_eds_title"
ebsco_link = if bento_query.present?
"#{ENV["EBSCO_SEARCH_URL"]}&custid=#{ENV["EDS_ORG"]}&bquery=TI+#{bento_query}"
"#{ENV["EBSCO_PUB_FINDER_URL"]}?searchField=titlename&searchtype=contains&highlightTag=mark&search=#{bento_query}"
else
"#{ENV["EBSCO_SEARCH_URL"]}&custid=#{ENV["EDS_ORG"]}"
ENV["EBSCO_PUB_FINDER_URL"].to_s
end
ebsco_link
elsif key == "finding_aids"
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/bento_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
conf.user_id = ENV["EDS_USER"]
conf.password = ENV["EDS_PASS"]
conf.profile = ENV["EDS_PROFILE"]
conf.title = "eResources (Online articles & ebooks)"
conf.title = "eResources (Online articles & chapters)"
conf.for_display = {decorator: "EbscoEdsArticleDecorator"}
conf.all_results_link = ENV["EDS_ALL_RESULTS_LINK"]
end
Expand All @@ -13,7 +13,7 @@
conf.user_id = ENV["EDS_USER"]
conf.password = ENV["EDS_PASS"]
conf.profile = ENV["EDS_PROFILE"]
conf.title = "eResources (Online journals)"
conf.title = "eResources (Online publications)"
conf.for_display = {decorator: "EbscoEdsArticleDecorator"}
conf.all_results_link = ENV["EDS_ALL_RESULTS_LINK"]
conf.search_field = "TI"
Expand Down
10 changes: 5 additions & 5 deletions spec/helpers/single_search_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,29 @@
end

it "returns a link to the EDS keyword search results page" do
expect(helper.bento_all_results_link("ebsco_eds_keyword")).to eq("https://search.ebscohost.com/login.aspx?authtype=ip,guest&groupid=main&profile=eds&direct=true&custid=test&bquery=hello")
expect(helper.bento_all_results_link("ebsco_eds_keyword")).to eq("https://research.ebsco.com/c/ciw6tp/search/results?q=hello&limiters=FT1%253AY&searchMode=all&searchSegment=all-results")
end

it "returns a link to the EDS title search results page" do
expect(helper.bento_all_results_link("ebsco_eds_title")).to eq("https://search.ebscohost.com/login.aspx?authtype=ip,guest&groupid=main&profile=eds&direct=true&custid=test&bquery=TI+hello")
expect(helper.bento_all_results_link("ebsco_eds_title")).to eq("https://publications.ebsco.com/c/elukgh?searchField=titlename&searchtype=contains&highlightTag=mark&search=hello")
end
end

context "when a query is not present" do
it "returns a link to the catalogue search results page" do
expect(helper.bento_all_results_link("catalogue")).to eq("http://test.host/catalog?search_field=all_fields&q=")
expect(helper.bento_all_results_link("catalogue")).to eq("http://test.host/catalog?search_field=all_fields&q=") # eq("https://search.ebscohost.com/login.aspx?authtype=ip,guest&groupid=main&profile=eds&direct=true&custid=test?q=hello&limiters=FT1%253AY&searchMode=all&searchSegment=all-results")
end

it "returns a link to the finding aids search results page" do
expect(helper.bento_all_results_link("finding_aids")).to eq("http://test.host/finding-aids/catalog?group=false&search_field=all_fields&q=")
end

it "returns a link to the EDS keyword search results page" do
expect(helper.bento_all_results_link("ebsco_eds_keyword")).to eq("https://search.ebscohost.com/login.aspx?authtype=ip,guest&groupid=main&profile=eds&direct=true&custid=test")
expect(helper.bento_all_results_link("ebsco_eds_keyword")).to eq("https://research.ebsco.com/c/ciw6tp/search/results")
end

it "returns a link to the EDS title search results page" do
expect(helper.bento_all_results_link("ebsco_eds_title")).to eq("https://search.ebscohost.com/login.aspx?authtype=ip,guest&groupid=main&profile=eds&direct=true&custid=test")
expect(helper.bento_all_results_link("ebsco_eds_title")).to eq("https://publications.ebsco.com/c/elukgh")
end
end
end
Expand Down
Loading