Giter Site home page Giter Site logo

SOooooooo about vacation-tracker HOT 1 CLOSED

davidneto92 avatar davidneto92 commented on July 30, 2024
SOooooooo

from vacation-tracker.

Comments (1)

davidneto92 avatar davidneto92 commented on July 30, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.