right_hook 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/right_hook/authenticator.rb +1 -1
- data/lib/right_hook/version.rb +1 -1
- data/spec/authenticator_spec.rb +2 -2
- metadata +1 -1
@@ -30,7 +30,7 @@ module RightHook
|
|
30
30
|
|
31
31
|
# Returns an array of all of the authorizations for the authenticated account.
|
32
32
|
def list_authorizations
|
33
|
-
_client.
|
33
|
+
_client.authorizations
|
34
34
|
end
|
35
35
|
|
36
36
|
# If there is already an authorization by this note, use it; otherwise create it
|
data/lib/right_hook/version.rb
CHANGED
data/spec/authenticator_spec.rb
CHANGED
@@ -38,7 +38,7 @@ describe RightHook::Authenticator do
|
|
38
38
|
describe '#find_or_create_authorization_by_note' do
|
39
39
|
let(:auth) { OpenStruct.new(token: 'a token', note: 'the note')}
|
40
40
|
context 'when #list_authorizations has a note that is an exact match' do
|
41
|
-
before { Octokit::Client.any_instance.should_receive(:
|
41
|
+
before { Octokit::Client.any_instance.should_receive(:authorizations).and_return([auth]) }
|
42
42
|
it 'returns that authorization' do
|
43
43
|
authenticator = described_class.build('octocat', 'pass')
|
44
44
|
expect(authenticator.find_or_create_authorization_by_note('the note')).to eq('a token')
|
@@ -46,7 +46,7 @@ describe RightHook::Authenticator do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
context 'when #list_authorizations does not have a note that matches' do
|
49
|
-
before { Octokit::Client.any_instance.should_receive(:
|
49
|
+
before { Octokit::Client.any_instance.should_receive(:authorizations).and_return([]) }
|
50
50
|
before { Octokit::Client.any_instance.should_receive(:create_authorization).and_return(auth) }
|
51
51
|
it 'creates a new authorization' do
|
52
52
|
authenticator = described_class.build('octocat', 'pass')
|