Skip to content

Commit

Permalink
Merge pull request #2474 from 18F/stages/rc-2018-08-30-patch-2
Browse files Browse the repository at this point in the history
Deploy RC 65 patch 2 to Int
  • Loading branch information
jgsmith-usds authored Aug 30, 2018
2 parents 4c45627 + 7f762d8 commit 1f15cc9
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/decorators/service_provider_session_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def sp_agency
end

def sp_return_url
if sp.redirect_uris.present? && openid_connect_redirector.valid?
if sp.redirect_uris.present? && request_url.is_a?(String) && openid_connect_redirector.valid?
openid_connect_redirector.decline_redirect_uri
else
sp.return_to_sp_url
Expand Down
4 changes: 4 additions & 0 deletions app/models/anonymous_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def second_factor_locked_at
nil
end

def phone_configuration
nil
end

def phone
nil
end
Expand Down
1 change: 1 addition & 0 deletions app/policies/sms_login_option_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ def initialize(user)
end

def configured?
return false unless user
user.phone_configuration.present?
end

Expand Down
9 changes: 0 additions & 9 deletions app/views/idv/shared/_failure_to_proof_url.html.slim

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/idv/shared/verification_failure.html.slim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= render 'shared/failure', presenter: presenter
p == presenter.warning_message

= render 'idv/shared/failure_to_proof_url', presenter: presenter
= render 'shared/failure_url', presenter: presenter

.mt3
= link_to presenter.button_text, presenter.button_path, class: 'btn btn-primary btn-link'
2 changes: 1 addition & 1 deletion app/views/shared/_failure.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ p == presenter.description

- if presenter.message.present?
h2.h4.mb2.mt3.my0 = presenter.message
= render 'idv/shared/failure_to_proof_url', presenter: presenter
= render 'shared/failure_url', presenter: presenter

- presenter.next_steps.each do |step|
p == step
Expand Down
12 changes: 12 additions & 0 deletions app/views/shared/_failure_url.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- if decorated_session.sp_name
hr
.mb2.mt2
.right = link_to image_tag(asset_url('carat-right.svg'), size: '10'),
decorated_session.failure_to_proof_url, class: 'bold block btn-link text-decoration-none'
- if request.path.starts_with?('/verify/')
= link_to t('idv.failure.help.get_help_html', sp_name: decorated_session.sp_name),
decorated_session.failure_to_proof_url, class: 'block btn-link text-decoration-none'
- elsif decorated_session.sp_return_url
= link_to t('links.back_to_sp', sp: decorated_session.sp_name),
decorated_session.sp_return_url, class: 'block btn-link text-decoration-none'
hr
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,14 @@
expect(response).to redirect_to(root_url)
end
end

context 'email is present in flash' do
it 'renders the show template' do
allow(controller).to receive(:flash).and_return(email: '[email protected]')
get :show

expect(response).to render_template(:show)
end
end
end
end
8 changes: 8 additions & 0 deletions spec/decorators/service_provider_session_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,12 @@
expect(subject.failure_to_proof_url).to eq url
end
end

describe '#sp_return_url' do
it 'does not raise an error if request_url is nil' do
allow(subject).to receive(:request_url).and_return(nil)
allow(sp).to receive(:redirect_uris).and_return(['foo'])
subject.sp_return_url
end
end
end

0 comments on commit 1f15cc9

Please sign in to comment.