Skip to content

Commit 34591b3

Browse files
committed
Additional WrongScopeError fixes for instance methods in SearchUtil
- Fix search_should_return, search_result, should_not_find_any, do_paginated_search - Replace api_url calls with Pedant::Config.pedant_platform.api_url directly - These helper methods are called from within examples but don't have access to api_url let
1 parent 95f7b28 commit 34591b3

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

oc-chef-pedant/lib/pedant/rspec/search_util.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ def search_should_return(options)
790790
user = options[:user] || admin_user
791791
results = options[:results]
792792
with_search_polling do
793-
get(api_url("/search/#{options[:type]}?q=#{options[:query]}"), user) do |response|
793+
get(Pedant::Config.pedant_platform.api_url("/search/#{options[:type]}?q=#{options[:query]}"), user) do |response|
794794
response.should look_like({
795795
status: 200,
796796
body: {
@@ -803,7 +803,7 @@ def search_should_return(options)
803803
end
804804

805805
def search_result(index, query)
806-
search_url = api_url(Addressable::URI.encode("/search/#{index}?q=#{query}"))
806+
search_url = Pedant::Config.pedant_platform.api_url(Addressable::URI.encode("/search/#{index}?q=#{query}"))
807807
get(search_url, admin_user)
808808
end
809809

@@ -895,15 +895,15 @@ def should_not_find(type, name)
895895

896896
def should_not_find_any(type)
897897
with_search_polling do
898-
result = authenticated_request(:GET, api_url("/search/#{type}"), requestor, {})
898+
result = authenticated_request(:GET, Pedant::Config.pedant_platform.api_url("/search/#{type}"), requestor, {})
899899
result.should have_status_code 200
900900
total = parse(result)["total"]
901901
total.should eq(0)
902902
end
903903
end
904904

905905
def do_paginated_search(type, start = 0, page_size = 1000, rows_accum = [])
906-
result = authenticated_request(:GET, api_url("/search/#{type}?start=#{start}&rows=#{page_size}"), requestor, {})
906+
result = authenticated_request(:GET, Pedant::Config.pedant_platform.api_url("/search/#{type}?start=#{start}&rows=#{page_size}"), requestor, {})
907907
result.should have_status_code 200
908908

909909
parsed_result = parse(result)

0 commit comments

Comments
 (0)