Comments (1)
Hmm, I think this is getting closer. I tried something with what you wrote but it still won't pass. Here is what I have:
let!(:expected_url) { "https://maps.googleapis.com/maps/api/directions/json?units=imperial&origin=Las%20Vegas,%20NV,%20United%20States&destination=Zion%20National%20Park4&key=#{ ENV["GOOGLE_DIRECTIONS_KEY"] }" }
let!(:response_json) { File.read("spec/support/first_test.json") }
let!(:params) { { destination: park_01.id, start_point: "Las Vegas, NV, United States" } }
# let!(:park_trip) { ParkTrip.new(params) }
before do
allow(RestClient).to receive(:get)
end
it "calls to restclient" do
park_trip = ParkTrip.new(params)
expect(RestClient).to have_received(:get).with(expected_url)
end
When I run this RestClient will only return nil. I put a pry in the parse_directions
method and RestClient is unable to .get
any url. Also, I don't think the response_json is being provided to RestClient.
from vacation-tracker.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vacation-tracker.