This application provides an easy and interactive way to track weather forecasts for multiple locations. Users can view, add, edit, or delete locations, with weather details like weekly highs and lows displayed visually using bar graphs.
- A homepage with a list of locations.
- Create a new location with an ip address or zipcode.
- View the highs and lows of the week and visualize them on a bar graph.
- Edit or delete locations.
- Frontend support for API error handling.
Clone the repository:
git clone https://github.com/oliverwstevens/weather.git
Change directory:
cd weather
Install dependencies:
bundle install
Apply migrations:
rails db:migrate
Start the Rails server
rails s
Open browser and visit:
http://localhost:3000
- Homepage: Visit the homepage to see a list of all your locations. Click on a location to view its weather details.
- View Weather Details: Observe the high and low temperatures for the week. Analyze the weather patterns using the bar graph.
- Add a Location: Click the “New Location” button. Enter a valid ZIP code or IP address and submit the form. If the input is invalid, an error message will guide you to correct it.
- Edit or Remove a Location: Select a location from the list. Use the "Edit" button to modify its details or the "Remove" button to remove it.
-
Set up database
rails db:setup –trace -
To run all the tests:
rspec spec -
To run only the location model validation tests:
rspec spec/models/location_spec.rb -
To run only the system tests:
rspec spec/system -
To run only the service object test:
rspec spec/services/weather_service_spec.rb