rspec_api_helpers 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a5a579f9650d9faa19a714f7dd15ea1c2ed6fe6
4
- data.tar.gz: 1b43e611b5657afa6cf226b30d4c608a196cf4c5
3
+ metadata.gz: 8a1e17e79bc6ff152ec742c852f3b699248b3d5b
4
+ data.tar.gz: fce990dba050f13b70183888fe77eb7950f97409
5
5
  SHA512:
6
- metadata.gz: a74c5e60f9e8a408c340bdc13f3fee6f58a1afd5b19fe793ca7de19f7da67f0ba6866d082c99c8b49930eaa5501c9fdf6b7f07ceb6c3c4cee3024ee816e1422d
7
- data.tar.gz: ae4a4d0373e2eab3cffdecc6dd65d0a918e74585841127430b92cc4a1989a112dfe69c9ff1c19341408ccfecb49980628ec7fa18d16067669fa5304e386a20e3
6
+ metadata.gz: 6f51ba9ae42ee63916870d3413140778080e9712145c3811ed1046ceb889747c414bf2ec4cea07bb80527d1fd222a0f80a0ac4ad61ba757d4320a0329030a11f
7
+ data.tar.gz: be1e3b6a07782c7b031fddef2963faff3d29b025b2708824bd429038ebe8632aaeefaf3d82a19ecefb989458d6db0cd8cab24d5eb2a6e8b935a34a2d42272597
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,5 @@
1
+ require 'active_support'
2
+
1
3
  module RspecApiHelpers
2
4
  module Json
3
5
  def response_body
@@ -1,3 +1,3 @@
1
1
  module RspecApiHelpers
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -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", "~> 4.0"
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"
@@ -5,11 +5,11 @@ describe RspecApiHelpers::Headers do
5
5
 
6
6
  it {is_expected.to be_a Hash }
7
7
 
8
- it 'should return CONTENT_TYPE' do
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 'should return ACCEPT' do
12
+ it 'returns ACCEPT as application/json' do
13
13
  expect(subject['ACCEPT']).to eq 'application/json'
14
14
  end
15
15
  end
@@ -17,11 +17,11 @@ describe RspecApiHelpers::Json do
17
17
  subject { parse_json data }
18
18
 
19
19
  describe '.parse_json' do
20
- it 'should have indifferent access' do
20
+ it 'has indifferent hash access' do
21
21
  expect(subject[:email]).to eq 'test@test.com'
22
22
  end
23
23
 
24
- it 'should have indifferent access (nested)' do
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 'should return a hash' do
32
+ it 'returns a hash' do
33
33
  expect(response_body).to be_a Hash
34
34
  end
35
35
 
36
- it 'return correct data' do
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
@@ -12,7 +12,7 @@ describe RspecApiHelpers::Strategies::JsonStrategy do
12
12
 
13
13
  subject { FactoryGirl.json :user }
14
14
 
15
- it 'should render user as json' do
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.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-19 00:00:00.000000000 Z
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: '4.0'
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: '4.0'
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