Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephGasiorekUSDS committed Jul 2, 2024
1 parent 6d1bbde commit bc1ea09
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 deletions.
22 changes: 11 additions & 11 deletions app/app/controllers/cbv/add_jobs_controller.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
class Cbv::AddJobsController < Cbv::BaseController
def show
end
def show
end

def create
additional_jobs = params[:additional_jobs]
if additional_jobs == "true"
redirect_to cbv_flow_employer_search_path
elsif additional_jobs == "false"
redirect_to cbv_flow_summary_path
else
redirect_to cbv_flow_add_job_path, notice: t(".notice")
end
def create
additional_jobs = params[:additional_jobs]
if additional_jobs == "true"
redirect_to cbv_flow_employer_search_path
elsif additional_jobs == "false"
redirect_to cbv_flow_summary_path
else
redirect_to cbv_flow_add_job_path, notice: t(".notice")
end
end
end
2 changes: 1 addition & 1 deletion app/app/controllers/cbv/payment_details_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def show

def employer_name
if @payments.any?
@payments.first[:employer_name]
@payments.first[:employer_name]
end
end

Expand Down
12 changes: 6 additions & 6 deletions app/app/views/cbv/add_jobs/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h2><%= t('.header', day_count: '90') %></h2>
<p><%= t('.subheader') %></p>
<h2><%= t(".header", day_count: "90") %></h2>
<p><%= t(".subheader") %></p>

<%= form_with(url: cbv_flow_add_job_path, builder: UswdsFormBuilder) do |f| %>
<%= f.radio_button(:additional_jobs, 'true', { 'label': t('.yes_radio')}) %>
<%= f.radio_button(:additional_jobs, 'false', { 'label': t('.no_radio')}) %>
<%= f.submit t('.continue') %>
<% end %>
<%= f.radio_button(:additional_jobs, "true", { 'label': t(".yes_radio") }) %>
<%= f.radio_button(:additional_jobs, "false", { 'label': t(".no_radio") }) %>
<%= f.submit t(".continue") %>
<% end %>
13 changes: 6 additions & 7 deletions app/app/views/cbv/payment_details/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
<h2>
<% if employer_name %>
<%= t('.header', employer_name: employer_name) %>
<%= t(".header", employer_name: employer_name) %>
<% else %>
<%= t('.header_no_employer_name') %>
<%= t(".header_no_employer_name") %>
<% end %>
</h2>
<% if @payments.any? %>
<p><%= t('.subheader', day_count: day_count, start_date: start_date, end_date: end_date) %></p>
<p><%= t(".subheader", day_count: day_count, start_date: start_date, end_date: end_date) %></p>
<ul>
<% @payments.each do |payment| %>
<li><%= t('.payment_of', amount: number_to_currency(payment[:amount])) %></li>
<li><%= t(".payment_of", amount: number_to_currency(payment[:amount])) %></li>
<% end %>
</ul>

<%= link_to next_path do %>
<button class="usa-button usa-button--outline" type="button">
<%= t('.continue') %>
<%= t(".continue") %>
</button>
<% end %>
<% else %>
<h3 class="site-preview-heading">
<%= t('.none_found') %>
<%= t(".none_found") %>
</h3>
<% end %>

4 changes: 2 additions & 2 deletions app/spec/controllers/cbv/add_jobs_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
end

it 'redirects when false radio button is selected' do
post :create, params: { 'additional_jobs': 'false' }
expect(response).to redirect_to(cbv_flow_summary_path)
post :create, params: { 'additional_jobs': 'false' }
expect(response).to redirect_to(cbv_flow_summary_path)
end

it 'redirects with notice when no radio button has been selected' do
Expand Down

0 comments on commit bc1ea09

Please sign in to comment.