Skip to content

Commit

Permalink
Update specs to reflect new feature
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipkamps committed Jun 14, 2022
1 parent 9a340a9 commit 7f597ce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
get "api/v1/book-search", to: "api/v1/books#search"

post "api/v1/sessions", to: "api/v1/sessions#create"

post "api/v1/road_trip", to: "api/v1/road_trip#create"
end
10 changes: 10 additions & 0 deletions spec/facades/location_facade_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@
expect(coords).to have_key :lat
expect(coords).to have_key :lng
end

it ".directions gets travel_time" do
origin = "madison,wi"
destination = "denver,co"

response = LocationFacade.directions(origin, destination)

expect(response).to be_a Directions
expect(response.travel_time).to be_an Integer
end
end
2 changes: 1 addition & 1 deletion spec/poros/forecast_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

expect(forecast.current[:dt]).to be_an Integer
expect(forecast.daily.count).to eq 5
expect(forecast.hourly.count).to eq 8
expect(forecast.hourly.count).to eq 48
end
end
10 changes: 10 additions & 0 deletions spec/services/location_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@
expect(response).to be_a Hash
expect(response).to have_key :results
end

it "gets directions from mapquest given two inputs" do
origin = "madison,wi"
destination = "denver,co"

response = LocationService.get_directions(origin, destination)

expect(response).to be_a Hash
expect(response[:route][:realTime]).to be_an Integer
end
end

0 comments on commit 7f597ce

Please sign in to comment.