Skip to content

Commit

Permalink
[#6] Update tests from class method to instance methods
Browse files Browse the repository at this point in the history
  • Loading branch information
malparty committed Jun 16, 2021
1 parent a930f34 commit b77e6fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/services/google_service/client_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def query_result
end

private

# Inspect Http response status code
# Any non 200 response code will be logged
# response is set to nil in order to notify the error
Expand Down
4 changes: 2 additions & 2 deletions spec/services/google_service/client_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
RSpec.describe GoogleService::ClientService, type: :service do
context 'when querying a simple keyword' do
it 'returns an HTTParty Response', vcr: 'google_search' do
result = described_class.query(FFaker::Lorem.word)
result = described_class.new(FFaker::Lorem.word).query_result

expect(result).to be_an_instance_of(HTTParty::Response)
end

it 'queries Google Search', vcr: 'google_search' do
path = described_class.query(FFaker::Lorem.word).request.path
path = described_class.new(FFaker::Lorem.word).query_result.request.path

expect(path.to_s).to start_with('https://www.google.com/search')
end
Expand Down

0 comments on commit b77e6fa

Please sign in to comment.