spec/aptible/auth/token_spec.rb in aptible-auth-1.2.4 vs spec/aptible/auth/token_spec.rb in aptible-auth-1.2.5

- old
+ new

@@ -65,9 +65,19 @@ :authenticate_impersonate ).with('tok tok tok', 'aptible:token', {}) described_class.create(user_token: 'tok tok tok') end + it( + 'should #authenticate_impersonate if passed ' \ + 'ssh_key_pre_authorization_href' + ) do + Aptible::Auth::Token.any_instance.should_receive( + :authenticate_impersonate + ).with('foo.href', 'aptible:ssh_key_pre_authorization:href', {}) + described_class.create(ssh_key_pre_authorization_href: 'foo.href') + end + it 'should not alter the hash it receives' do options = { email: 'some email' } options_before = options.dup expect { described_class.create options }.to raise_error(/Unrecognized/) expect(options).to eq(options_before)