Skip to content

Commit

Permalink
test: weather service refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdurbin committed Aug 4, 2024
1 parent 93ea81e commit f063530
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions spec/services/weather_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@

expect(response[:forecast][:forecastday].first[:hour].first).to have_key(:time)
expect(response[:forecast][:forecastday].first[:hour].first).to have_key(:temp_f)
expect(response[:forecast][:forecastday].first[:hour].first).to_not have_key(:humidity)
expect(response[:forecast][:forecastday].first[:hour].first).to_not have_key(:cloud)
expect(response[:forecast][:forecastday].first[:hour].first).to_not have_key(:cloud)
expect(response[:forecast][:forecastday].first[:hour].first).to have_key(:condition)
expect(response[:forecast][:forecastday].first[:hour].first[:condition]).to have_key(:text)
expect(response[:forecast][:forecastday].first[:hour].first[:condition]).to have_key(:icon)
expect(response[:forecast][:forecastday].first[:hour].first.count).to eq 3
end
end

Expand All @@ -64,12 +65,7 @@

expect(response[:forecast][:forecastday].first[:astro]).to have_key(:sunrise)
expect(response[:forecast][:forecastday].first[:astro]).to have_key(:sunset)
expect(response[:forecast][:forecastday].first[:astro]).to_not have_key(:moonrise)
expect(response[:forecast][:forecastday].first[:astro]).to_not have_key(:moonset)
expect(response[:forecast][:forecastday].first[:astro]).to_not have_key(:moon_illumination)
expect(response[:forecast][:forecastday].first[:astro]).to_not have_key(:is_sun_up)
expect(response[:forecast][:forecastday].first[:astro]).to_not have_key(:is_moon_up)
expect(response[:forecast][:forecastday].first[:astro]).to_not have_key(:moon_phase)
expect(response[:forecast][:forecastday].first[:astro].count).to eq 2
end
end
end

0 comments on commit f063530

Please sign in to comment.