sonar-client 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sonar/client.rb +1 -1
- data/lib/sonar/version.rb +1 -1
- data/spec/sonar/registration_spec.rb +15 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44bc1c4f74efaf45f7278f7d6c9088aac904ba12
|
4
|
+
data.tar.gz: 4eefe89872fa73d36ee480cbdea39bd259937e73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1a22b2aa4749e1d86d88d146bdcbb983d3f15f4b4fdc690915dd1f88c25c026e4df50025b3884d924ac38f73938a70401ca448f07ce2d8ecdda2ef77c4e403
|
7
|
+
data.tar.gz: 7ee849d4e4e84add1cad073fcf1b9d507ba987fd7e28aa870a19677fe4fb0d6963da88dc9c69078fadbfea66eebe9e89a3a2bcab3be15506ab651838d6eca708
|
data/lib/sonar/client.rb
CHANGED
data/lib/sonar/version.rb
CHANGED
@@ -5,28 +5,36 @@ describe Sonar::Registration do
|
|
5
5
|
let(:client) { Sonar::Client.new }
|
6
6
|
|
7
7
|
context 'POSTing a valid product key' do
|
8
|
-
let (:resp)
|
8
|
+
let (:resp) do
|
9
|
+
VCR.use_cassette("valid_ms_registration") do
|
10
|
+
client.register_metasploit("SOME-VALID-KEY")
|
11
|
+
end
|
12
|
+
end
|
9
13
|
|
10
|
-
|
14
|
+
it 'responds that the license is valid' do
|
11
15
|
expect(resp).to have_key('valid')
|
12
16
|
expect(resp['valid']).to be(true)
|
13
17
|
end
|
14
|
-
|
18
|
+
it 'responds with a user email' do
|
15
19
|
expect(resp).to have_key('email')
|
16
|
-
expect(resp['email']).to
|
20
|
+
expect(resp['email']).to eq('metasploit-sdafsaefaef@rapid7.com')
|
17
21
|
end
|
18
|
-
|
22
|
+
it 'responds with an api_key' do
|
19
23
|
expect(resp).to have_key('api_key')
|
20
|
-
expect(resp['api_key']).to match(
|
24
|
+
expect(resp['api_key']).to match('YOUR-VALID-API-KEY')
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
24
28
|
context 'POSTing an invalid product key' do
|
25
29
|
let (:resp) { client.register_metasploit("DDXXXX") }
|
26
30
|
|
27
|
-
|
31
|
+
it 'responds that the license is invalid' do
|
28
32
|
expect(resp).to have_key('valid')
|
29
33
|
expect(resp['valid']).to be(false)
|
30
34
|
end
|
35
|
+
it 'responds with an error message' do
|
36
|
+
expect(resp).to have_key('error')
|
37
|
+
expect(resp['error']).to match(/not appear to be valid/)
|
38
|
+
end
|
31
39
|
end
|
32
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sonar-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Deardorff & HD Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday_middleware
|