Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/views/idv/how_to_verify/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@
},
],
) %>
<%= render 'idv/doc_auth/cancel', step: 'how_to_verify' %>
43 changes: 43 additions & 0 deletions spec/views/idv/how_to_verify/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
require 'rails_helper'

RSpec.describe 'idv/how_to_verify/show.html.erb' do
selection = Idv::HowToVerifyForm::IPP
let(:idv_how_to_verify_form) do
Idv::HowToVerifyForm.new(selection: selection)
end

before do
allow(view).to receive(:user_signing_up?).and_return(false)

assign :idv_how_to_verify_form, idv_how_to_verify_form
render
end

context 'renders the show template with' do
it 'a title and info text' do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - can we change this to something like it 'has expected title and info text' so it reads more naturally?

Copy link
Copy Markdown
Contributor Author

@gina-yamada gina-yamada Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@svalexander Here is how it currently reads when you run the specs

Screenshot 2024-03-27 at 4 38 19 PM

Existing: renders the show template with a title and info text.
Your suggestion: renders the show template with has expected title and info text.

I initially had expected in each but thought about it being implicitly implied because there was a test for it. I am willing to change it but wondering with this extra information if you'd still like to see that change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh lol yes you're right, ignore my comments about updating language

expect(rendered).to have_content(t('doc_auth.headings.how_to_verify'))
expect(rendered).to have_content(t('doc_auth.info.how_to_verify'))
end

it 'two options for verifying your identity' do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is similar enough to the above test that I don't think it's needed

expect(rendered).to have_content(t('doc_auth.headings.verify_online'))
expect(rendered).to have_content(t('doc_auth.headings.verify_at_post_office'))
end

it 'a continue button' do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - can we change this to something like 'it 'has a continue button'?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar thought for the other 2 tests that proceed this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this comment based on the screenshot you provided above

expect(rendered).to have_button(t('forms.buttons.continue'))
end

it 'a troubleshooting section' do
expect(rendered).to have_content(
t('doc_auth.info.how_to_verify_troubleshooting_options_header'),
)
expect(rendered).to have_link(t('doc_auth.info.verify_online_link_text'))
expect(rendered).to have_link(t('doc_auth.info.verify_at_post_office_link_text'))
end

it 'a cancel link' do
expect(rendered).to have_link(t('links.cancel'))
end
end
end