Skip to content

Commit

Permalink
[#6] Declare vcr inline to improve code readability
Browse files Browse the repository at this point in the history
Rebase from raw
  • Loading branch information
malparty committed Jun 30, 2021
1 parent 42d55fe commit c397bd3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/services/google_service/client_service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

require 'rails_helper'

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)

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

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

0 comments on commit c397bd3

Please sign in to comment.