generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests for air quality alerts
- Loading branch information
1 parent
2bfd2b2
commit 48c863a
Showing
2 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
spec/features/visitors/view_styled_air_quality_alerts_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Feature: View air quality alerts | ||
# - So that I can take appropriate protective action | ||
# - As a visitor | ||
# - I want to see Air quality alerts for air pollution predictions with warning | ||
# statuses above "low" | ||
RSpec.feature "Air quality alerts", feature: true do | ||
around do |example| | ||
env_vars = { | ||
CERC_API_HOST_URL: "https://cerc.example.com", | ||
CERC_API_KEY: "SECRET-API-KEY", | ||
CERC_API_CACHE_LIMIT_MINS: "60", | ||
MAPTILER_API_KEY: "TOPSECRET" | ||
} | ||
ClimateControl.modify(env_vars) { example.run } | ||
end | ||
|
||
include AirQualitySteps, ForecastSteps | ||
|
||
before do | ||
given_an_air_pollution_prediction_for_today_w_high_warning_status | ||
and_an_air_pollution_prediction_for_tomorrow_w_moderate_warning_status | ||
and_an_air_pollution_prediction_for_day_after_tomorrow_w_v_high_warning_status | ||
and_the_response_from_cercs_api_is_stubbed_accordingly | ||
end | ||
|
||
scenario "View air quality alert for today" do | ||
when_i_look_at_the_forecasts_v2 | ||
then_i_see_an_air_quality_alert_of_high_for_today_v2 | ||
end | ||
|
||
scenario "View air quality alert for tomorrow", js: true do | ||
visit root_path | ||
when_i_select_view_forecasts_v2 | ||
and_i_switch_to_the_tab_for_tomorrow | ||
|
||
then_i_see_an_air_quality_alert_of_moderate_for_tomorrow_v2 | ||
end | ||
|
||
scenario "View air quality alert for the day after tomorrow", js: true do | ||
visit root_path | ||
when_i_select_view_forecasts_v2 | ||
and_i_switch_to_the_tab_for_day_after_tomorrow | ||
|
||
then_i_see_an_air_quality_alert_of_v_high_for_day_after_tomorrow_v2 | ||
end | ||
end |