diff options
| author | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-01 12:16:42 +1000 |
|---|---|---|
| committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-01 12:47:30 +1000 |
| commit | 2bdf08e732ad5d959bfebd222e58a7cd4a4971eb (patch) | |
| tree | 1676c34376205ace5088b34c4a124c86ca7f8d9e /spec/action | |
| parent | a686b9a0ee4c180b272b26e45c9a2c6cb84c742c (diff) | |
| parent | e3fead94b6f71d3501d586cbb2295ea0d1da2b31 (diff) | |
| download | gitlab-shell-2bdf08e732ad5d959bfebd222e58a7cd4a4971eb.tar.gz | |
Merge remote-tracking branch 'origin/master' into ash.mckenzie/srp-refactor
Diffstat (limited to 'spec/action')
| -rw-r--r-- | spec/action/api_2fa_recovery.rb_spec.rb | 8 | ||||
| -rw-r--r-- | spec/action/git_lfs_authenticate_spec.rb | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/spec/action/api_2fa_recovery.rb_spec.rb b/spec/action/api_2fa_recovery.rb_spec.rb index ab09ed2..bfdadd6 100644 --- a/spec/action/api_2fa_recovery.rb_spec.rb +++ b/spec/action/api_2fa_recovery.rb_spec.rb @@ -3,18 +3,18 @@ require_relative '../../lib/action/api_2fa_recovery' describe Action::API2FARecovery do let(:key_id) { '1' } - let(:key) { Actor::Key.new(key_id) } + let(:actor) { Actor::Key.new(key_id) } let(:username) { 'testuser' } let(:discover_payload) { { 'username' => username } } let(:api) { double(GitlabNet) } before do allow(GitlabNet).to receive(:new).and_return(api) - allow(api).to receive(:discover).with(key_id).and_return(discover_payload) + allow(api).to receive(:discover).with(actor).and_return(discover_payload) end subject do - described_class.new(key) + described_class.new(actor) end describe '#execute' do @@ -46,7 +46,7 @@ describe Action::API2FARecovery do before do expect(subject).to receive(:continue?).and_return(true) - expect(api).to receive(:two_factor_recovery_codes).with(key_id).and_return(response) + expect(api).to receive(:two_factor_recovery_codes).with(subject).and_return(response) end context 'with a unsuccessful response' do diff --git a/spec/action/git_lfs_authenticate_spec.rb b/spec/action/git_lfs_authenticate_spec.rb index 20740db..3c84d0c 100644 --- a/spec/action/git_lfs_authenticate_spec.rb +++ b/spec/action/git_lfs_authenticate_spec.rb @@ -4,24 +4,24 @@ require_relative '../../lib/action/git_lfs_authenticate' describe Action::GitLFSAuthenticate do let(:key_id) { '1' } let(:repo_name) { 'gitlab-ci.git' } - let(:key) { Actor::Key.new(key_id) } + let(:actor) { Actor::Key.new(key_id) } let(:username) { 'testuser' } let(:discover_payload) { { 'username' => username } } let(:api) { double(GitlabNet) } before do allow(GitlabNet).to receive(:new).and_return(api) - allow(api).to receive(:discover).with(key_id).and_return(discover_payload) + allow(api).to receive(:discover).with(actor).and_return(discover_payload) end subject do - described_class.new(key, repo_name) + described_class.new(actor, repo_name) end describe '#execute' do context 'when response from API is not a success' do before do - expect(api).to receive(:lfs_authenticate).with(key_id, repo_name).and_return(nil) + expect(api).to receive(:lfs_authenticate).with(subject, repo_name).and_return(nil) end it 'returns nil' do @@ -36,7 +36,7 @@ describe Action::GitLFSAuthenticate do let(:gitlab_lfs_authentication) { GitlabLfsAuthentication.new(username, lfs_token, repository_http_path) } before do - expect(api).to receive(:lfs_authenticate).with(key_id, repo_name).and_return(gitlab_lfs_authentication) + expect(api).to receive(:lfs_authenticate).with(subject, repo_name).and_return(gitlab_lfs_authentication) end it 'puts payload to stdout' do |
