rspec_api_helpers 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rspec_api_helpers/json.rb +2 -0
- data/lib/rspec_api_helpers/version.rb +1 -1
- data/rspec_api_helpers.gemspec +1 -1
- data/spec/headers_spec.rb +2 -2
- data/spec/json_spec.rb +7 -4
- data/spec/strategies_spec.rb +1 -1
- metadata +6 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a1e17e79bc6ff152ec742c852f3b699248b3d5b
|
4
|
+
data.tar.gz: fce990dba050f13b70183888fe77eb7950f97409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f51ba9ae42ee63916870d3413140778080e9712145c3811ed1046ceb889747c414bf2ec4cea07bb80527d1fd222a0f80a0ac4ad61ba757d4320a0329030a11f
|
7
|
+
data.tar.gz: be1e3b6a07782c7b031fddef2963faff3d29b025b2708824bd429038ebe8632aaeefaf3d82a19ecefb989458d6db0cd8cab24d5eb2a6e8b935a34a2d42272597
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/rspec_api_helpers.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "activesupport"
|
20
|
+
spec.add_dependency "activesupport"
|
21
21
|
spec.add_dependency "factory_girl", "~> 4.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.7"
|
data/spec/headers_spec.rb
CHANGED
@@ -5,11 +5,11 @@ describe RspecApiHelpers::Headers do
|
|
5
5
|
|
6
6
|
it {is_expected.to be_a Hash }
|
7
7
|
|
8
|
-
it '
|
8
|
+
it 'returns CONTENT_TYPE as application/json' do
|
9
9
|
expect(subject['CONTENT_TYPE']).to eq 'application/json'
|
10
10
|
end
|
11
11
|
|
12
|
-
it '
|
12
|
+
it 'returns ACCEPT as application/json' do
|
13
13
|
expect(subject['ACCEPT']).to eq 'application/json'
|
14
14
|
end
|
15
15
|
end
|
data/spec/json_spec.rb
CHANGED
@@ -17,11 +17,11 @@ describe RspecApiHelpers::Json do
|
|
17
17
|
subject { parse_json data }
|
18
18
|
|
19
19
|
describe '.parse_json' do
|
20
|
-
it '
|
20
|
+
it 'has indifferent hash access' do
|
21
21
|
expect(subject[:email]).to eq 'test@test.com'
|
22
22
|
end
|
23
23
|
|
24
|
-
it '
|
24
|
+
it 'has indifferent hash access for nested hashes' do
|
25
25
|
expect(subject[:location][:city]).to eq 'Somewhere'
|
26
26
|
end
|
27
27
|
end
|
@@ -29,12 +29,15 @@ describe RspecApiHelpers::Json do
|
|
29
29
|
describe '.response_body' do
|
30
30
|
before { allow(response).to receive(:body) { data } }
|
31
31
|
|
32
|
-
it '
|
32
|
+
it 'returns a hash' do
|
33
33
|
expect(response_body).to be_a Hash
|
34
34
|
end
|
35
35
|
|
36
|
-
it '
|
36
|
+
it 'parses JSON correctly' do
|
37
37
|
expect(response_body[:email]).to eq 'test@test.com'
|
38
|
+
expect(response_body[:data]).to eq 'is good'
|
39
|
+
expect(response_body[:location][:city]).to eq 'Somewhere'
|
40
|
+
expect(response_body[:location][:state]).to eq 'Cool'
|
38
41
|
end
|
39
42
|
end
|
40
43
|
end
|
data/spec/strategies_spec.rb
CHANGED
@@ -12,7 +12,7 @@ describe RspecApiHelpers::Strategies::JsonStrategy do
|
|
12
12
|
|
13
13
|
subject { FactoryGirl.json :user }
|
14
14
|
|
15
|
-
it '
|
15
|
+
it 'represents user in JSON format' do
|
16
16
|
expect(subject).to eq '{"email":"test@test.com","name":"Mrs. Mock"}'
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_api_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
@@ -30,22 +30,22 @@ cert_chain:
|
|
30
30
|
YGBeYMyEy7Q4wf7k4k5yyDUZyyaeg0DF/kNEN5llspJ9DHMP2cQqOiH+IQSNiUhR
|
31
31
|
32sJqaZRHeJLDhZPLi5yXItTsQnPy6uob2oyypwFYTM=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-12-
|
33
|
+
date: 2014-12-22 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: activesupport
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '0'
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '0'
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: factory_girl
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|