Skip to content

Commit c1e1a79

Browse files
committed
Apply suggestions
1 parent cf2ceee commit c1e1a79

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

app/app/views/launcher/advanced.html.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
<div class="usa-radio">
112112
<input class="usa-radio__input usa-radio__input--tile" type="radio"
113113
name="test_scenario" id="test_scenario_scott" value="scott"
114-
data-action="advanced-launcher#selectScenario">
114+
data-action="advanced-launcher#selectScenario"
115+
data-reporting-window-months="2">
115116
<label class="usa-radio__label" for="test_scenario_scott">
116117
<strong>Scott Tobin</strong>
117118
<span class="advanced-launcher__scenario-desc">Not currently enrolled (enrollment older than 18 months)</span>
@@ -120,7 +121,8 @@
120121
<div class="usa-radio">
121122
<input class="usa-radio__input usa-radio__input--tile" type="radio"
122123
name="test_scenario" id="test_scenario_linda" value="linda"
123-
data-action="advanced-launcher#selectScenario">
124+
data-action="advanced-launcher#selectScenario"
125+
data-reporting-window-months="2">
124126
<label class="usa-radio__label" for="test_scenario_linda">
125127
<strong>Linda Cooper</strong>
126128
<span class="advanced-launcher__scenario-desc">No NSC record found</span>

app/spec/controllers/launcher_controller_advanced_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@
5454
expect(rendered).to include('Ziggy Testuser')
5555
end
5656

57+
it "gives every NSC test scenario a reporting window so selecting one does not leave a stale months pill", :aggregate_failures do
58+
get :advanced
59+
rendered = response.body
60+
61+
%w[lynette rick dominique scott linda].each do |scenario_key|
62+
radio = rendered[/<input[^>]*id="test_scenario_#{scenario_key}"[^>]*>/]
63+
expect(radio).to be_present, "expected a radio for #{scenario_key}"
64+
expect(radio).to include('data-reporting-window-months'), "expected #{scenario_key} to set reporting window months"
65+
end
66+
end
67+
5768
it "displays fake test scenario options with single and multi-term" do
5869
get :advanced
5970
rendered = response.body

app/spec/support/nsc_api_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def nsc_load_relative_json_file(user_folder, filename)
5656
JSON.parse(File.read(nsc_fixture_path(user_folder, filename)))
5757
end
5858

59-
# Re-record every fixture against the live NSC sandbox:
59+
# Re-record every fixture against the live NSC sandbox, from the repo root:
6060
#
6161
# ```
62-
# bin/rails runner 'require "./spec/support/nsc_api_helper"; include NscApiHelper; nsc_save_all_fixtures'
62+
# cd app && bin/rails runner 'require "./spec/support/nsc_api_helper"; include NscApiHelper; nsc_save_all_fixtures'
6363
# ```
6464
def nsc_save_all_fixtures
6565
FIXTURE_PERSONAS.each_key { |user_folder| nsc_save_fixture_for_user(user_folder) }

0 commit comments

Comments
 (0)