lhs 15.3.1 → 15.3.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 +4 -4
- data/.rubocop.localch.yml +158 -21
- data/.rubocop.yml +9 -3
- data/lhs.gemspec +10 -9
- data/lib/lhs/complex.rb +1 -1
- data/lib/lhs/concerns/autoload_records.rb +1 -1
- data/lib/lhs/concerns/collection/handle_nested.rb +1 -1
- data/lib/lhs/concerns/inspect.rb +1 -1
- data/lib/lhs/concerns/item/validation.rb +2 -2
- data/lib/lhs/concerns/proxy/accessors.rb +1 -1
- data/lib/lhs/concerns/proxy/problems.rb +1 -1
- data/lib/lhs/concerns/record/chainable.rb +1 -1
- data/lib/lhs/concerns/record/endpoints.rb +2 -2
- data/lib/lhs/concerns/record/model.rb +1 -1
- data/lib/lhs/concerns/record/request.rb +5 -5
- data/lib/lhs/data.rb +5 -4
- data/lib/lhs/endpoint.rb +1 -1
- data/lib/lhs/item.rb +8 -0
- data/lib/lhs/pagination/base.rb +0 -1
- data/lib/lhs/problems/base.rb +1 -1
- data/lib/lhs/record.rb +1 -1
- data/lib/lhs/version.rb +1 -1
- data/spec/autoloading_spec.rb +4 -4
- data/spec/collection/accessors_spec.rb +1 -1
- data/spec/collection/collection_items_spec.rb +1 -1
- data/spec/collection/configurable_spec.rb +1 -1
- data/spec/collection/meta_data_spec.rb +1 -1
- data/spec/collection/to_a_spec.rb +1 -1
- data/spec/collection/to_ary_spec.rb +6 -2
- data/spec/collection/without_object_items_spec.rb +1 -1
- data/spec/complex/reduce_spec.rb +2 -2
- data/spec/concerns/record/request_spec.rb +1 -1
- data/spec/data/collection_spec.rb +1 -1
- data/spec/data/equality_spec.rb +1 -1
- data/spec/data/inspect_spec.rb +1 -1
- data/spec/data/is_item_or_collection_spec.rb +1 -1
- data/spec/data/item_spec.rb +1 -1
- data/spec/data/merge_spec.rb +1 -1
- data/spec/data/parent_spec.rb +1 -1
- data/spec/data/raw_spec.rb +1 -1
- data/spec/data/respond_to_spec.rb +3 -3
- data/spec/data/root_spec.rb +1 -1
- data/spec/data/select_spec.rb +1 -1
- data/spec/data/to_ary_spec.rb +26 -0
- data/spec/data/to_json_spec.rb +1 -1
- data/spec/endpoint/for_url_spec.rb +1 -1
- data/spec/item/access_errors_spec.rb +1 -1
- data/spec/item/accessors_spec.rb +1 -1
- data/spec/item/add_error_spec.rb +1 -1
- data/spec/item/becomes_spec.rb +1 -1
- data/spec/item/blacklisted_keywords_spec.rb +1 -1
- data/spec/item/delegate_spec.rb +1 -1
- data/spec/item/destroy_spec.rb +2 -2
- data/spec/item/dig_spec.rb +1 -1
- data/spec/item/error_codes_spec.rb +1 -1
- data/spec/item/errors_spec.rb +22 -22
- data/spec/item/fetch_spec.rb +1 -1
- data/spec/item/getter_spec.rb +1 -1
- data/spec/item/internal_data_structure_spec.rb +1 -1
- data/spec/item/map_spec.rb +1 -1
- data/spec/item/partial_update_spec.rb +3 -3
- data/spec/item/save_spec.rb +2 -2
- data/spec/item/setter_spec.rb +1 -1
- data/spec/item/translate_errors_spec.rb +1 -1
- data/spec/item/update_spec.rb +1 -1
- data/spec/item/validation_spec.rb +4 -4
- data/spec/item/warning_codes_spec.rb +1 -1
- data/spec/item/warnings_spec.rb +1 -3
- data/spec/pagination/pages_left_spec.rb +1 -1
- data/spec/pagination/parameters_spec.rb +1 -1
- data/spec/proxy/create_sub_resource_spec.rb +5 -5
- data/spec/proxy/load_spec.rb +8 -10
- data/spec/proxy/record_identification_spec.rb +1 -1
- data/spec/record/all_spec.rb +3 -3
- data/spec/record/build_spec.rb +1 -1
- data/spec/record/cast_nested_data_spec.rb +1 -1
- data/spec/record/chain_error_handling_spec.rb +1 -1
- data/spec/record/create_spec.rb +4 -4
- data/spec/record/creation_failed_spec.rb +2 -2
- data/spec/record/definitions_spec.rb +1 -1
- data/spec/record/destroy_spec.rb +1 -1
- data/spec/record/dig_configuration_spec.rb +1 -1
- data/spec/record/endpoint_inheritance_spec.rb +3 -3
- data/spec/record/endpoint_options_spec.rb +2 -2
- data/spec/record/endpoints_spec.rb +7 -7
- data/spec/record/equality_spec.rb +1 -1
- data/spec/record/expanded_spec.rb +1 -1
- data/spec/record/fetch_spec.rb +1 -1
- data/spec/record/find_by_chains_spec.rb +1 -1
- data/spec/record/find_by_spec.rb +2 -2
- data/spec/record/find_each_spec.rb +1 -1
- data/spec/record/find_in_batches_spec.rb +2 -2
- data/spec/record/find_in_parallel_spec.rb +2 -2
- data/spec/record/find_spec.rb +3 -3
- data/spec/record/first_spec.rb +2 -2
- data/spec/record/handle_includes_errors_spec.rb +1 -1
- data/spec/record/has_many_spec.rb +3 -3
- data/spec/record/ignore_errors_spec.rb +5 -14
- data/spec/record/immutable_chains_spec.rb +1 -1
- data/spec/record/includes_all_spec.rb +6 -6
- data/spec/record/includes_spec.rb +13 -13
- data/spec/record/includes_warning_spec.rb +1 -1
- data/spec/record/item_key_spec.rb +1 -1
- data/spec/record/items_created_key_configuration_spec.rb +1 -1
- data/spec/record/mapping_spec.rb +1 -1
- data/spec/record/model_name_spec.rb +1 -1
- data/spec/record/new_spec.rb +5 -5
- data/spec/record/options_spec.rb +5 -5
- data/spec/record/paginatable_collection_spec.rb +5 -6
- data/spec/record/pagination_chain_spec.rb +3 -3
- data/spec/record/pagination_links_spec.rb +1 -1
- data/spec/record/pagination_spec.rb +1 -1
- data/spec/record/persisted_spec.rb +2 -1
- data/spec/record/references_spec.rb +1 -1
- data/spec/record/reload_by_id_spec.rb +1 -1
- data/spec/record/reload_spec.rb +2 -2
- data/spec/record/request_spec.rb +3 -3
- data/spec/record/scope_chains_spec.rb +1 -1
- data/spec/record/to_hash_spec.rb +1 -1
- data/spec/record/to_json_spec.rb +1 -1
- data/spec/record/where_chains_spec.rb +3 -3
- data/spec/record/where_spec.rb +1 -1
- data/spec/record/where_values_hash_spec.rb +1 -1
- data/spec/request_cycle_cache/main_spec.rb +2 -1
- data/spec/require_lhs_spec.rb +1 -1
- data/spec/support/cleanup.rb +1 -1
- data/spec/support/request_cycle_cache.rb +1 -1
- data/spec/views/form_for_spec.rb +1 -1
- metadata +47 -31
data/spec/record/all_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
4
|
context 'all' do
|
5
|
-
before
|
5
|
+
before do
|
6
6
|
class Record < LHS::Record
|
7
7
|
endpoint 'http://datastore/feedbacks'
|
8
8
|
end
|
@@ -60,7 +60,7 @@ describe LHS::Record do
|
|
60
60
|
end
|
61
61
|
|
62
62
|
context 'all without current page indicator' do
|
63
|
-
before
|
63
|
+
before do
|
64
64
|
class Category < LHS::Record
|
65
65
|
configuration(
|
66
66
|
items_key: %i(response results),
|
@@ -84,7 +84,7 @@ describe LHS::Record do
|
|
84
84
|
)
|
85
85
|
end
|
86
86
|
|
87
|
-
it 'is able to fetch all remote objects without any current page indicator by simply increasing the offset until response is empty' do
|
87
|
+
it 'is able to fetch all remote objects without any current page indicator by simply increasing the offset until response is empty with a limit' do
|
88
88
|
stub_batch('http://store/categories?language=en&max=10&offset=0')
|
89
89
|
stub_batch('http://store/categories?language=en&max=10&offset=10')
|
90
90
|
stub_batch('http://store/categories?language=en&max=10&offset=20')
|
data/spec/record/build_spec.rb
CHANGED
data/spec/record/create_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe LHS::Record do
|
|
4
4
|
context 'create' do
|
5
5
|
let(:datastore) { 'http://local.ch/v2' }
|
6
6
|
|
7
|
-
before
|
7
|
+
before do
|
8
8
|
LHC.config.placeholder('datastore', datastore)
|
9
9
|
class Feedback < LHS::Record
|
10
10
|
endpoint '{+datastore}/content-ads/{campaign_id}/feedbacks'
|
@@ -79,7 +79,7 @@ describe LHS::Record do
|
|
79
79
|
end
|
80
80
|
|
81
81
|
context 'custom setters' do
|
82
|
-
before
|
82
|
+
before do
|
83
83
|
class Feedback
|
84
84
|
def ratings=(ratings)
|
85
85
|
_raw[:ratings] = ratings.map { |k, v| { name: k.to_s, value: v } }
|
@@ -117,7 +117,7 @@ describe LHS::Record do
|
|
117
117
|
end
|
118
118
|
|
119
119
|
context 'and custom getters' do
|
120
|
-
before
|
120
|
+
before do
|
121
121
|
class Feedback
|
122
122
|
def ratings
|
123
123
|
Hash[_raw[:ratings].map { |r| [r[:name].to_sym, r[:value]] }]
|
@@ -133,7 +133,7 @@ describe LHS::Record do
|
|
133
133
|
end
|
134
134
|
|
135
135
|
context 'location header' do
|
136
|
-
before
|
136
|
+
before do
|
137
137
|
class ContactPerson < LHS::Record
|
138
138
|
endpoint 'http://datastore/contact_persons'
|
139
139
|
end
|
@@ -4,7 +4,7 @@ describe LHS::Record do
|
|
4
4
|
context 'creation failed' do
|
5
5
|
let(:datastore) { 'http://local.ch/v2' }
|
6
6
|
|
7
|
-
before
|
7
|
+
before do
|
8
8
|
LHC.config.placeholder(:datastore, datastore)
|
9
9
|
class Record < LHS::Record
|
10
10
|
endpoint '{+datastore}/{campaign_id}/feedbacks'
|
@@ -35,7 +35,7 @@ describe LHS::Record do
|
|
35
35
|
.to_return(status: 400, body: creation_error.to_json)
|
36
36
|
record = Record.create(name: 'Steve')
|
37
37
|
expect(record).to be_kind_of Record
|
38
|
-
expect(record.errors).to
|
38
|
+
expect(record.errors).to be_present
|
39
39
|
expect(record.name).to eq 'Steve'
|
40
40
|
expect(record.errors.include?(:ratings)).to eq true
|
41
41
|
expect(record.errors.include?(:recommended)).to eq true
|
data/spec/record/destroy_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
4
|
context 'inherit endpoints' do
|
5
|
-
before
|
5
|
+
before do
|
6
6
|
class Base < LHS::Record
|
7
7
|
endpoint 'records/{id}'
|
8
8
|
end
|
@@ -20,7 +20,7 @@ describe LHS::Record do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
context 'define endpoints in subclass' do
|
23
|
-
before
|
23
|
+
before do
|
24
24
|
class Base < LHS::Record
|
25
25
|
endpoint 'records/{id}'
|
26
26
|
end
|
@@ -40,7 +40,7 @@ describe LHS::Record do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
context 'clashing endpoints between super and subclass' do
|
43
|
-
before
|
43
|
+
before do
|
44
44
|
class Base < LHS::Record
|
45
45
|
endpoint 'records'
|
46
46
|
end
|
@@ -2,7 +2,7 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
4
|
context 'set options for an endpoint' do
|
5
|
-
before
|
5
|
+
before do
|
6
6
|
class Record < LHS::Record
|
7
7
|
endpoint 'backend/v2/feedbacks/{id}', cache_expires_in: 1.day, retry: 2, cache: true
|
8
8
|
end
|
@@ -20,7 +20,7 @@ describe LHS::Record do
|
|
20
20
|
|
21
21
|
context 'deep merge endpoint options' do
|
22
22
|
|
23
|
-
before
|
23
|
+
before do
|
24
24
|
class Location < LHS::Record
|
25
25
|
endpoint 'http://uberall/locations', headers: { privateKey: '123' }
|
26
26
|
end
|
@@ -4,7 +4,7 @@ describe LHS::Record do
|
|
4
4
|
context 'endpoints' do
|
5
5
|
let(:datastore) { 'http://local.ch/v2' }
|
6
6
|
|
7
|
-
before
|
7
|
+
before do
|
8
8
|
LHC.config.placeholder(:datastore, datastore)
|
9
9
|
class Record < LHS::Record
|
10
10
|
endpoint '{+datastore}/entries/{entry_id}/content-ads/{campaign_id}/feedbacks'
|
@@ -14,9 +14,9 @@ describe LHS::Record do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'stores all the endpoints by url' do
|
17
|
-
expect(LHS::Record::Endpoints.all['{+datastore}/entries/{entry_id}/content-ads/{campaign_id}/feedbacks']).to
|
18
|
-
expect(LHS::Record::Endpoints.all['{+datastore}/{campaign_id}/feedbacks']).to
|
19
|
-
expect(LHS::Record::Endpoints.all['{+datastore}/feedbacks']).to
|
17
|
+
expect(LHS::Record::Endpoints.all['{+datastore}/entries/{entry_id}/content-ads/{campaign_id}/feedbacks']).to be_present
|
18
|
+
expect(LHS::Record::Endpoints.all['{+datastore}/{campaign_id}/feedbacks']).to be_present
|
19
|
+
expect(LHS::Record::Endpoints.all['{+datastore}/feedbacks']).to be_present
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'stores the endpoints of the service' do
|
@@ -42,7 +42,7 @@ describe LHS::Record do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
context 'compute url from endpoint' do
|
45
|
-
before
|
45
|
+
before do
|
46
46
|
class Feedback < LHS::Record
|
47
47
|
endpoint '{+datastore}/feedbacks'
|
48
48
|
endpoint '{+datastore}/feedbacks/{id}'
|
@@ -56,7 +56,7 @@ describe LHS::Record do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
context 'unsorted endpoints' do
|
59
|
-
before
|
59
|
+
before do
|
60
60
|
class AnotherRecord < LHS::Record
|
61
61
|
endpoint '{+datastore}/feedbacks'
|
62
62
|
endpoint '{+datastore}/{campaign_id}/feedbacks'
|
@@ -71,7 +71,7 @@ describe LHS::Record do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
context 'includes data without considering base endpoint of parent record if url is present' do
|
74
|
-
before
|
74
|
+
before do
|
75
75
|
class Contract < LHS::Record
|
76
76
|
endpoint '{+datastore}/contracts/:id'
|
77
77
|
endpoint '{+datastore}/entry/{entry_id}/contracts'
|
data/spec/record/fetch_spec.rb
CHANGED
data/spec/record/find_by_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rails_helper'
|
|
3
3
|
describe LHS::Record do
|
4
4
|
let(:datastore) { 'http://local.ch/v2' }
|
5
5
|
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
LHC.config.placeholder(:datastore, datastore)
|
8
8
|
class Record < LHS::Record
|
9
9
|
endpoint '{+datastore}/content-ads/{campaign_id}/feedbacks'
|
@@ -44,7 +44,7 @@ describe LHS::Record do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
context 'when record has custom configurations for limit_key' do
|
47
|
-
before
|
47
|
+
before do
|
48
48
|
class Record < LHS::Record
|
49
49
|
endpoint '{+datastore}/feedbacks/{id}'
|
50
50
|
configuration(
|
@@ -17,7 +17,7 @@ describe LHS::Collection do
|
|
17
17
|
|
18
18
|
let(:datastore) { 'http://local.ch/v2' }
|
19
19
|
|
20
|
-
before
|
20
|
+
before do
|
21
21
|
LHC.config.placeholder('datastore', datastore)
|
22
22
|
class Record < LHS::Record
|
23
23
|
endpoint '{+datastore}/{campaign_id}/feedbacks'
|
@@ -65,7 +65,7 @@ describe LHS::Collection do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
context 'configured pagination' do
|
68
|
-
before
|
68
|
+
before do
|
69
69
|
class Record < LHS::Record
|
70
70
|
endpoint '{+datastore}/{campaign_id}/feedbacks'
|
71
71
|
endpoint '{+datastore}/feedbacks'
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
|
-
before
|
4
|
+
before do
|
5
5
|
class Record < LHS::Record
|
6
6
|
endpoint 'http://datastore/records/{id}'
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
10
|
context 'find in parallel' do
|
11
|
-
before
|
11
|
+
before do
|
12
12
|
stub_request(:get, "http://datastore/records/1").to_return(status: 200, body: { id: 1 }.to_json)
|
13
13
|
stub_request(:get, "http://datastore/records/3").to_return(status: 200, body: { id: 3 }.to_json)
|
14
14
|
end
|
data/spec/record/find_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rails_helper'
|
|
3
3
|
describe LHS::Record do
|
4
4
|
let(:datastore) { 'http://local.ch/v2' }
|
5
5
|
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
LHC.config.placeholder(:datastore, datastore)
|
8
8
|
class Record < LHS::Record
|
9
9
|
endpoint '{+datastore}/content-ads/{campaign_id}/feedbacks'
|
@@ -15,7 +15,7 @@ describe LHS::Record do
|
|
15
15
|
|
16
16
|
context 'find' do
|
17
17
|
context 'finds a single unique record' do
|
18
|
-
before
|
18
|
+
before do
|
19
19
|
stub_request(:get, "#{datastore}/feedbacks/z12f-3asm3ngals")
|
20
20
|
.to_return(status: 200, body: load_json(:feedback))
|
21
21
|
end
|
@@ -34,7 +34,7 @@ describe LHS::Record do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
context 'endpoint without identifier' do
|
37
|
-
before
|
37
|
+
before do
|
38
38
|
class LatestAGB < LHS::Record
|
39
39
|
endpoint 'agbs/latest'
|
40
40
|
end
|
data/spec/record/first_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rails_helper'
|
|
3
3
|
describe LHS::Record do
|
4
4
|
let(:datastore) { 'http://local.ch/v2' }
|
5
5
|
|
6
|
-
before
|
6
|
+
before do
|
7
7
|
LHC.config.placeholder(:datastore, datastore)
|
8
8
|
class Record < LHS::Record
|
9
9
|
endpoint '{+datastore}/content-ads/{campaign_id}/feedbacks'
|
@@ -17,7 +17,7 @@ describe LHS::Record do
|
|
17
17
|
.to_return(status: 200, body: load_json(:feedback))
|
18
18
|
record = Record.first
|
19
19
|
expect(record).to be_kind_of Record
|
20
|
-
expect(record.source_id).to
|
20
|
+
expect(record.source_id).to be_present
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'returns nil if no record was found' do
|
@@ -4,7 +4,7 @@ describe LHS::Record do
|
|
4
4
|
|
5
5
|
let(:listing) { location.listings.first }
|
6
6
|
|
7
|
-
before
|
7
|
+
before do
|
8
8
|
stub_request(:get, 'http://uberall/locations/1')
|
9
9
|
.to_return(body: {
|
10
10
|
listings: [{
|
@@ -15,7 +15,7 @@ describe LHS::Record do
|
|
15
15
|
|
16
16
|
context 'has_many' do
|
17
17
|
|
18
|
-
before
|
18
|
+
before do
|
19
19
|
class Location < LHS::Record
|
20
20
|
endpoint 'http://uberall/locations'
|
21
21
|
endpoint 'http://uberall/locations/{id}'
|
@@ -45,7 +45,7 @@ describe LHS::Record do
|
|
45
45
|
|
46
46
|
context 'custom class_name' do
|
47
47
|
|
48
|
-
before
|
48
|
+
before do
|
49
49
|
module Uberall
|
50
50
|
class Location < LHS::Record
|
51
51
|
endpoint 'http://uberall/locations'
|
@@ -4,7 +4,7 @@ describe LHS::Record do
|
|
4
4
|
let(:handler) { spy('handler') }
|
5
5
|
let(:record_json) { { color: 'blue' }.to_json }
|
6
6
|
|
7
|
-
before
|
7
|
+
before do
|
8
8
|
class Record < LHS::Record
|
9
9
|
endpoint 'http://local.ch/v2/records'
|
10
10
|
endpoint 'http://local.ch/v2/records/{id}'
|
@@ -23,7 +23,7 @@ describe LHS::Record do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
context 'multiple ignored errors' do
|
26
|
-
it 'ignores error if
|
26
|
+
it 'ignores error if first of them is specified' do
|
27
27
|
stub_request(:get, "http://local.ch/v2/records?color=blue").to_return(status: 401)
|
28
28
|
record = Record
|
29
29
|
.ignore(LHC::Unauthorized)
|
@@ -33,7 +33,7 @@ describe LHS::Record do
|
|
33
33
|
expect(record).to eq nil
|
34
34
|
end
|
35
35
|
|
36
|
-
it 'ignores error if
|
36
|
+
it 'ignores error if last of them is specified' do
|
37
37
|
stub_request(:get, "http://local.ch/v2/records?color=blue").to_return(status: 404)
|
38
38
|
record = Record
|
39
39
|
.ignore(LHC::Unauthorized)
|
@@ -53,15 +53,6 @@ describe LHS::Record do
|
|
53
53
|
expect(record).to eq nil
|
54
54
|
end
|
55
55
|
|
56
|
-
it 'can ignore multiple error with one ignore call' do
|
57
|
-
stub_request(:get, "http://local.ch/v2/records?color=blue").to_return(status: 401)
|
58
|
-
record = Record
|
59
|
-
.ignore(LHC::Unauthorized, LHC::NotFound)
|
60
|
-
.where(color: 'blue')
|
61
|
-
.fetch
|
62
|
-
expect(record).to eq nil
|
63
|
-
end
|
64
|
-
|
65
56
|
it 'can ignore multiple error with one ignore call, on chain start' do
|
66
57
|
stub_request(:get, "http://local.ch/v2/records?color=blue").to_return(status: 401)
|
67
58
|
record = Record
|
@@ -100,7 +91,7 @@ describe LHS::Record do
|
|
100
91
|
expect(record).to eq nil
|
101
92
|
end
|
102
93
|
|
103
|
-
it 'returns nil also when ignoring errors on
|
94
|
+
it 'returns nil also when ignoring errors on fetch' do
|
104
95
|
stub_request(:get, "http://local.ch/v2/records?color=blue").to_return(status: 500, body: body)
|
105
96
|
record = Record
|
106
97
|
.ignore(LHC::Error)
|
@@ -109,7 +100,7 @@ describe LHS::Record do
|
|
109
100
|
expect(record).to eq nil
|
110
101
|
end
|
111
102
|
|
112
|
-
it 'returns nil also when ignoring errors on
|
103
|
+
it 'returns nil also when ignoring errors on find_by' do
|
113
104
|
stub_request(:get, "http://local.ch/v2/records?color=blue&limit=1").to_return(status: 500, body: body)
|
114
105
|
record = Record
|
115
106
|
.ignore(LHC::Error)
|