-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LG-11147: Break up MFA selection presenter classes for PivCac (#9581)
* create setup and sign in piv cac files * remove login and setup label changelog: Internal, Presenter improvements, break up PIV/CAC presenter * make changes in configuration and two fact options presenter * create setup piv cac selection presenter * test for sign in piv cac selection presenter * run the build again * modify set up piv_cac_selection_presenter and spec * delete piv_cac_presenter, modify two factor login options presenter * more fixing up two factor login options presenter spec * more changes for piv cac setup and sign in presenters * modify for set up piv cac selection * mess with setup selection presenter some more * fix setup test * delete `configuration` from test
- Loading branch information
Showing
11 changed files
with
88 additions
and
38 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
15 changes: 0 additions & 15 deletions
15
app/presenters/two_factor_authentication/piv_cac_selection_presenter.rb
This file was deleted.
Oops, something went wrong.
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
23 changes: 23 additions & 0 deletions
23
app/presenters/two_factor_authentication/set_up_piv_cac_selection_presenter.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,23 @@ | ||
module TwoFactorAuthentication | ||
class SetUpPivCacSelectionPresenter < SetUpSelectionPresenter | ||
def method | ||
:piv_cac | ||
end | ||
|
||
def label | ||
t('two_factor_authentication.two_factor_choice_options.piv_cac') | ||
end | ||
|
||
def info | ||
t('two_factor_authentication.two_factor_choice_options.piv_cac_info') | ||
end | ||
|
||
def single_configuration_only? | ||
true | ||
end | ||
|
||
def mfa_configuration_count | ||
user.piv_cac_configurations.count | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletions
15
app/presenters/two_factor_authentication/sign_in_piv_cac_selection_presenter.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,15 @@ | ||
module TwoFactorAuthentication | ||
class SignInPivCacSelectionPresenter < SignInSelectionPresenter | ||
def method | ||
:piv_cac | ||
end | ||
|
||
def label | ||
t('two_factor_authentication.login_options.piv_cac') | ||
end | ||
|
||
def info | ||
t('two_factor_authentication.login_options.piv_cac_info') | ||
end | ||
end | ||
end |
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
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
32 changes: 32 additions & 0 deletions
32
spec/presenters/two_factor_authentication/sign_in_piv_cac_selection_presenter.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,32 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe TwoFactorAuthentication::SignInPivCacSelectionPresenter do | ||
let(:user) { create(:user) } | ||
let(:configuration) { create(:piv_cac_configuration, user: user) } | ||
|
||
let(:presenter) do | ||
described_class.new(user: user, configuration: configuration) | ||
end | ||
|
||
describe '#type' do | ||
it 'returns piv_cac' do | ||
expect(presenter.type).to eq 'piv_cac' | ||
end | ||
end | ||
|
||
describe '#label' do | ||
it 'returns the label text' do | ||
expect(presenter.label).to eq( | ||
t('two_factor_authentication.two_factor_choice_options.piv_cac'), | ||
) | ||
end | ||
end | ||
|
||
describe '#info' do | ||
it 'returns the info text' do | ||
expect(presenter.info).to eq( | ||
t('two_factor_authentication.login_options.piv_cac_info'), | ||
) | ||
end | ||
end | ||
end |
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
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
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