lhs 3.0.0 → 3.0.1
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 +190 -0
- data/.rubocop.yml +7 -0
- data/cider-ci.yml +2 -1
- data/cider-ci/jobs/rspec.yml +48 -0
- data/cider-ci/jobs/rubocop.yml +55 -0
- data/cider-ci/scripts/bundle.yml +2 -0
- data/cider-ci/scripts/github_comment.yml +6 -0
- data/cider-ci/scripts/rspec.yml +4 -0
- data/cider-ci/scripts/rubocop.yml +5 -0
- data/cider-ci/scripts/ruby-version.yml +2 -0
- data/cider-ci/scripts/tmp-cache.yml +2 -0
- data/lhs.gemspec +1 -0
- data/lib/lhs/collection.rb +2 -6
- data/lib/lhs/concerns/data/json.rb +1 -1
- data/lib/lhs/concerns/item/save.rb +11 -10
- data/lib/lhs/concerns/item/update.rb +1 -1
- data/lib/lhs/concerns/item/validation.rb +2 -2
- data/lib/lhs/concerns/record/all.rb +1 -2
- data/lib/lhs/concerns/record/batch.rb +2 -3
- data/lib/lhs/concerns/record/create.rb +7 -8
- data/lib/lhs/concerns/record/endpoints.rb +2 -3
- data/lib/lhs/concerns/record/find.rb +6 -6
- data/lib/lhs/concerns/record/find_by.rb +8 -8
- data/lib/lhs/concerns/record/first.rb +0 -1
- data/lib/lhs/concerns/record/includes.rb +0 -1
- data/lib/lhs/concerns/record/mapping.rb +0 -1
- data/lib/lhs/concerns/record/model.rb +0 -1
- data/lib/lhs/concerns/record/request.rb +18 -14
- data/lib/lhs/concerns/record/where.rb +0 -1
- data/lib/lhs/data.rb +3 -4
- data/lib/lhs/endpoint.rb +1 -2
- data/lib/lhs/errors.rb +7 -13
- data/lib/lhs/item.rb +5 -9
- data/lib/lhs/record.rb +12 -8
- data/lib/lhs/version.rb +1 -1
- data/spec/collection/delegate_spec.rb +0 -2
- data/spec/collection/enumerable_spec.rb +2 -4
- data/spec/collection/meta_data_spec.rb +0 -1
- data/spec/collection/respond_to_spec.rb +0 -1
- data/spec/collection/without_object_items_spec.rb +0 -1
- data/spec/data/collection_spec.rb +4 -7
- data/spec/data/item_spec.rb +3 -5
- data/spec/data/merge_spec.rb +7 -9
- data/spec/data/raw_spec.rb +3 -5
- data/spec/data/respond_to_spec.rb +3 -5
- data/spec/data/root_spec.rb +3 -5
- data/spec/data/select_spec.rb +2 -4
- data/spec/data/to_json_spec.rb +5 -7
- data/spec/dummy/bin/rails +1 -1
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/initializers/cookies_serializer.rb +1 -1
- data/spec/endpoint/for_url_spec.rb +3 -5
- data/spec/item/delegate_spec.rb +0 -2
- data/spec/item/destroy_spec.rb +3 -5
- data/spec/item/errors_spec.rb +20 -23
- data/spec/item/getter_spec.rb +1 -3
- data/spec/item/internal_data_structure_spec.rb +2 -3
- data/spec/item/respond_to_spec.rb +1 -1
- data/spec/item/save_spec.rb +7 -10
- data/spec/item/setter_spec.rb +2 -4
- data/spec/item/update_spec.rb +4 -7
- data/spec/item/validation_spec.rb +7 -9
- data/spec/proxy/load_spec.rb +0 -2
- data/spec/record/all_spec.rb +10 -12
- data/spec/record/build_spec.rb +0 -2
- data/spec/record/create_spec.rb +8 -10
- data/spec/record/creation_failed_spec.rb +4 -6
- data/spec/record/definitions_spec.rb +1 -3
- data/spec/record/endpoint_misconfiguration_spec.rb +2 -4
- data/spec/record/endpoint_options_spec.rb +0 -2
- data/spec/record/endpoints_spec.rb +1 -6
- data/spec/record/find_each_spec.rb +2 -4
- data/spec/record/find_in_batches_spec.rb +4 -6
- data/spec/record/find_spec.rb +10 -13
- data/spec/record/first_spec.rb +0 -3
- data/spec/record/includes_spec.rb +15 -20
- data/spec/record/mapping_spec.rb +13 -15
- data/spec/record/model_name_spec.rb +0 -2
- data/spec/record/new_spec.rb +4 -2
- data/spec/record/request_spec.rb +1 -3
- data/spec/record/where_spec.rb +1 -3
- data/spec/spec_helper.rb +1 -1
- data/spec/support/cleanup_configuration.rb +0 -2
- data/spec/support/cleanup_endpoints.rb +0 -1
- data/spec/support/cleanup_records.rb +0 -2
- metadata +26 -4
- data/cider-ci/contexts/rspec.yml +0 -16
- data/cider-ci/jobs/tests.yml +0 -27
data/spec/item/getter_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Item do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
@@ -10,11 +9,10 @@ describe LHS::Item do
|
|
10
9
|
end
|
11
10
|
|
12
11
|
let(:data) do
|
13
|
-
LHS::Data.new({addresses: [{business: {identities: [{name: 'Löwenzorn'}]}}]}, nil, Record)
|
12
|
+
LHS::Data.new({ addresses: [{ business: { identities: [{ name: 'Löwenzorn' }] } }] }, nil, Record)
|
14
13
|
end
|
15
14
|
|
16
15
|
context 'item getter' do
|
17
|
-
|
18
16
|
it 'returns a collection if you access an array' do
|
19
17
|
expect(data.addresses).to be_kind_of(LHS::Data)
|
20
18
|
expect(data.addresses._proxy).to be_kind_of(LHS::Collection)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Item do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Feedback < LHS::Record
|
7
6
|
endpoint ':datastore/v2/feedbacks'
|
@@ -10,7 +9,7 @@ describe LHS::Item do
|
|
10
9
|
end
|
11
10
|
|
12
11
|
let(:hash) do
|
13
|
-
{'addresses' => [{'businesses' => {'identities' => [{'name' => 'Löwenzorn'}]}}]}
|
12
|
+
{ 'addresses' => [{ 'businesses' => { 'identities' => [{ 'name' => 'Löwenzorn' }] } }] }
|
14
13
|
end
|
15
14
|
|
16
15
|
let(:data) do
|
@@ -32,7 +31,7 @@ describe LHS::Item do
|
|
32
31
|
it 'deep symbolizes internal data when building new objects' do
|
33
32
|
feedback = Feedback.build('name' => 'BB8')
|
34
33
|
expect(feedback._data._raw.keys).to include(:name)
|
35
|
-
end
|
34
|
+
end
|
36
35
|
|
37
36
|
it 'can handle ActionController::Parameters' do
|
38
37
|
params = ActionController::Parameters.new('name' => 'Han')
|
data/spec/item/save_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Item do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
@@ -22,7 +21,6 @@ describe LHS::Item do
|
|
22
21
|
end
|
23
22
|
|
24
23
|
context 'save' do
|
25
|
-
|
26
24
|
it 'persists changes on the backend' do
|
27
25
|
stub_request(:post, item.href).with(body: item._raw.merge(name: 'Steve').to_json)
|
28
26
|
item.name = 'Steve'
|
@@ -31,27 +29,26 @@ describe LHS::Item do
|
|
31
29
|
|
32
30
|
it 'returns false if persting goes wrong' do
|
33
31
|
stub_request(:post, item.href)
|
34
|
-
|
35
|
-
|
32
|
+
.with(body: item._raw.to_json)
|
33
|
+
.to_return(status: 500)
|
36
34
|
expect(item.save).to eq false
|
37
35
|
end
|
38
36
|
|
39
37
|
it 'merges reponse data with object' do
|
40
38
|
stub_request(:post, item.href)
|
41
|
-
|
42
|
-
|
39
|
+
.with(body: item._raw.to_json)
|
40
|
+
.to_return(status: 200, body: item._raw.merge(name: 'Steve').to_json)
|
43
41
|
item.save
|
44
42
|
expect(item.name).to eq 'Steve'
|
45
43
|
end
|
46
44
|
end
|
47
45
|
|
48
46
|
context 'save!' do
|
49
|
-
|
50
47
|
it 'raises if something goes wrong' do
|
51
48
|
stub_request(:post, item.href)
|
52
|
-
|
53
|
-
|
54
|
-
expect(->{ item.save! }).to raise_error LHC::ServerError
|
49
|
+
.with(body: item._raw.to_json)
|
50
|
+
.to_return(status: 500)
|
51
|
+
expect(-> { item.save! }).to raise_error LHC::ServerError
|
55
52
|
end
|
56
53
|
end
|
57
54
|
end
|
data/spec/item/setter_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Item do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
@@ -22,16 +21,15 @@ describe LHS::Item do
|
|
22
21
|
end
|
23
22
|
|
24
23
|
context 'item setter' do
|
25
|
-
|
26
24
|
it 'sets the value for an existing attribute' do
|
27
|
-
expect(item.name = 'Steve').to eq 'Steve'
|
25
|
+
expect((item.name = 'Steve')).to eq 'Steve'
|
28
26
|
expect(item.name).to eq 'Steve'
|
29
27
|
expect(item._raw[:name]).to eq 'Steve'
|
30
28
|
end
|
31
29
|
|
32
30
|
it 'sets things to nil' do
|
33
31
|
item.name = 'Steve'
|
34
|
-
expect(item.name = nil).to eq nil
|
32
|
+
expect((item.name = nil)).to eq nil
|
35
33
|
expect(item.name).to eq nil
|
36
34
|
end
|
37
35
|
end
|
data/spec/item/update_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Item do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
@@ -22,10 +21,9 @@ describe LHS::Item do
|
|
22
21
|
end
|
23
22
|
|
24
23
|
context 'update' do
|
25
|
-
|
26
24
|
it 'persists changes on the backend' do
|
27
25
|
stub_request(:post, item.href)
|
28
|
-
|
26
|
+
.with(body: item._raw.merge(name: 'Steve').to_json)
|
29
27
|
result = item.update(name: 'Steve')
|
30
28
|
expect(result).to eq true
|
31
29
|
end
|
@@ -53,12 +51,11 @@ describe LHS::Item do
|
|
53
51
|
end
|
54
52
|
|
55
53
|
context 'update!' do
|
56
|
-
|
57
54
|
it 'raises if something goes wrong' do
|
58
55
|
stub_request(:post, item.href)
|
59
|
-
|
60
|
-
|
61
|
-
expect(->{ item.update!(name: 'Steve') }).to raise_error LHC::ServerError
|
56
|
+
.with(body: item._raw.merge(name: 'Steve').to_json)
|
57
|
+
.to_return(status: 500)
|
58
|
+
expect(-> { item.update!(name: 'Steve') }).to raise_error LHC::ServerError
|
62
59
|
end
|
63
60
|
end
|
64
61
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Item do
|
4
|
-
|
5
4
|
let(:datastore) { 'http://local.ch' }
|
6
5
|
|
7
6
|
before(:each) do
|
@@ -13,8 +12,8 @@ describe LHS::Item do
|
|
13
12
|
end
|
14
13
|
|
15
14
|
let(:mock_validation) do
|
16
|
-
|
17
|
-
|
15
|
+
successful_validation
|
16
|
+
end
|
18
17
|
|
19
18
|
let(:successful_validation) do
|
20
19
|
stub_request(:post, "#{datastore}/v2/users?persist=false").to_return(body: '{}')
|
@@ -23,10 +22,10 @@ describe LHS::Item do
|
|
23
22
|
let(:failing_validation) do
|
24
23
|
stub_request(:post, "#{datastore}/v2/users?persist=false")
|
25
24
|
.to_return(status: 400,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
body: {
|
26
|
+
field_errors: [{ code: "UNSUPPORTED_PROPERTY_VALUE", "path" => ["email"] }]
|
27
|
+
}.to_json
|
28
|
+
)
|
30
29
|
end
|
31
30
|
|
32
31
|
context 'valid data' do
|
@@ -48,7 +47,6 @@ describe LHS::Item do
|
|
48
47
|
end
|
49
48
|
|
50
49
|
context 'invalid data' do
|
51
|
-
|
52
50
|
let(:user) do
|
53
51
|
User.build(email: 'im not an email address')
|
54
52
|
end
|
@@ -79,7 +77,7 @@ describe LHS::Item do
|
|
79
77
|
end
|
80
78
|
|
81
79
|
it 'fails when trying to use an endpoint for validations that does not support it' do
|
82
|
-
expect(
|
80
|
+
expect(lambda {
|
83
81
|
Favorite.build.valid?
|
84
82
|
}).to raise_error('Endpoint does not support validations!')
|
85
83
|
end
|
data/spec/proxy/load_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Proxy do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/feedbacks'
|
@@ -30,7 +29,6 @@ describe LHS::Proxy do
|
|
30
29
|
end
|
31
30
|
|
32
31
|
context 'load' do
|
33
|
-
|
34
32
|
it 'is loading data remotely when not present yet' do
|
35
33
|
expect(link.load!.id).to be
|
36
34
|
expect(link.id).to be
|
data/spec/record/all_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Collection do
|
4
|
-
|
5
4
|
let(:datastore) { 'http://local.ch/v2' }
|
6
5
|
|
7
6
|
before(:each) do
|
@@ -13,41 +12,40 @@ describe LHS::Collection do
|
|
13
12
|
end
|
14
13
|
|
15
14
|
context 'all' do
|
16
|
-
|
17
15
|
it 'fetches all records from the backend' do
|
18
16
|
stub_request(:get, "#{datastore}/feedbacks?limit=100")
|
19
|
-
|
17
|
+
.to_return(status: 200, body: { items: (1..100).to_a, total: 300, limit: 100, offset: 0 }.to_json)
|
20
18
|
stub_request(:get, "#{datastore}/feedbacks?limit=100&offset=101")
|
21
|
-
|
19
|
+
.to_return(status: 200, body: { items: (101..200).to_a, total: 300, limit: 100, offset: 101 }.to_json)
|
22
20
|
stub_request(:get, "#{datastore}/feedbacks?limit=100&offset=201")
|
23
|
-
|
21
|
+
.to_return(status: 200, body: { items: (201..300).to_a, total: 300, limit: 100, offset: 201 }.to_json)
|
24
22
|
all = Record.all
|
25
23
|
expect(all).to be_kind_of Record
|
26
|
-
expect(all._proxy).to be_kind_of
|
24
|
+
expect(all._proxy).to be_kind_of described_class
|
27
25
|
expect(all.count).to eq 300
|
28
26
|
expect(all.last).to eq 300
|
29
27
|
end
|
30
28
|
|
31
29
|
it 'also fetches all when there is not meta information for limit' do
|
32
30
|
stub_request(:get, "#{datastore}/feedbacks?limit=100")
|
33
|
-
|
31
|
+
.to_return(status: 200, body: { items: (1..100).to_a, total: 300, offset: 0 }.to_json)
|
34
32
|
stub_request(:get, "#{datastore}/feedbacks?limit=100&offset=101")
|
35
|
-
|
33
|
+
.to_return(status: 200, body: { items: (101..200).to_a, total: 300, offset: 101 }.to_json)
|
36
34
|
stub_request(:get, "#{datastore}/feedbacks?limit=100&offset=201")
|
37
|
-
|
35
|
+
.to_return(status: 200, body: { items: (201..300).to_a, total: 300, offset: 201 }.to_json)
|
38
36
|
all = Record.all
|
39
37
|
expect(all).to be_kind_of Record
|
40
|
-
expect(all._proxy).to be_kind_of
|
38
|
+
expect(all._proxy).to be_kind_of described_class
|
41
39
|
expect(all.count).to eq 300
|
42
40
|
expect(all.last).to eq 300
|
43
41
|
end
|
44
42
|
|
45
43
|
it 'also works when there is no item in the first response' do
|
46
44
|
stub_request(:get, "#{datastore}/feedbacks?limit=100")
|
47
|
-
.to_return(status: 200, body: {items: [], total: 300, offset: 0}.to_json)
|
45
|
+
.to_return(status: 200, body: { items: [], total: 300, offset: 0 }.to_json)
|
48
46
|
all = Record.all
|
49
47
|
expect(all).to be_kind_of Record
|
50
|
-
expect(all._proxy).to be_kind_of
|
48
|
+
expect(all._proxy).to be_kind_of described_class
|
51
49
|
expect(all.count).to eq 0
|
52
50
|
end
|
53
51
|
end
|
data/spec/record/build_spec.rb
CHANGED
data/spec/record/create_spec.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
|
-
|
5
4
|
context 'create' do
|
6
|
-
|
7
5
|
let(:datastore) { 'http://local.ch/v2' }
|
8
6
|
|
9
7
|
before(:each) do
|
@@ -33,16 +31,16 @@ describe LHS::Record do
|
|
33
31
|
|
34
32
|
it 'uses proper endpoint when creating data' do
|
35
33
|
stub_request(:post, "#{datastore}/content-ads/12345/feedbacks")
|
36
|
-
|
37
|
-
|
34
|
+
.with(body: object.to_json)
|
35
|
+
.to_return(status: 200, body: object.to_json)
|
38
36
|
Feedback.create(object.merge(campaign_id: '12345'))
|
39
37
|
end
|
40
38
|
|
41
39
|
it 'merges backend response object with object' do
|
42
40
|
body = object.merge(additional_key: 1)
|
43
41
|
stub_request(:post, "#{datastore}/content-ads/12345/feedbacks")
|
44
|
-
|
45
|
-
|
42
|
+
.with(body: object.to_json)
|
43
|
+
.to_return(status: 200, body: body.to_json)
|
46
44
|
data = Feedback.create(object.merge(campaign_id: '12345'))
|
47
45
|
expect(data.additional_key).to eq 1
|
48
46
|
end
|
@@ -55,9 +53,9 @@ describe LHS::Record do
|
|
55
53
|
{
|
56
54
|
"name" => "ratings",
|
57
55
|
"details" => [{ "code" => "REQUIRED_PROPERTY_VALUE" }]
|
58
|
-
|
56
|
+
}, {
|
59
57
|
"name" => "recommended",
|
60
|
-
"details" => [{"code" => "REQUIRED_PROPERTY_VALUE"}]
|
58
|
+
"details" => [{ "code" => "REQUIRED_PROPERTY_VALUE" }]
|
61
59
|
}
|
62
60
|
]
|
63
61
|
}
|
@@ -72,8 +70,8 @@ describe LHS::Record do
|
|
72
70
|
|
73
71
|
it 'raises an exception when creation failed using create!' do
|
74
72
|
stub_request(:post, "#{datastore}/content-ads/12345/feedbacks")
|
75
|
-
|
76
|
-
expect(
|
73
|
+
.to_return(status: 400, body: creation_error.to_json)
|
74
|
+
expect(lambda {
|
77
75
|
Feedback.create!(object.merge(campaign_id: '12345'))
|
78
76
|
}).to raise_error
|
79
77
|
end
|
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
|
-
|
5
4
|
context 'creation failed' do
|
6
|
-
|
7
5
|
let(:datastore) { 'http://local.ch/v2' }
|
8
6
|
|
9
7
|
before(:each) do
|
@@ -24,9 +22,9 @@ describe LHS::Record do
|
|
24
22
|
{
|
25
23
|
"name" => "ratings",
|
26
24
|
"details" => [{ "code" => "REQUIRED_PROPERTY_VALUE" }]
|
27
|
-
},{
|
25
|
+
}, {
|
28
26
|
"name" => "recommended",
|
29
|
-
"details" => [{"code" => "REQUIRED_PROPERTY_VALUE"}]
|
27
|
+
"details" => [{ "code" => "REQUIRED_PROPERTY_VALUE" }]
|
30
28
|
}
|
31
29
|
]
|
32
30
|
}
|
@@ -42,13 +40,13 @@ describe LHS::Record do
|
|
42
40
|
expect(record.errors.include?(:ratings)).to eq true
|
43
41
|
expect(record.errors.include?(:recommended)).to eq true
|
44
42
|
expect(record.errors[:ratings]).to eq ['REQUIRED_PROPERTY_VALUE']
|
45
|
-
expect(record.errors.messages).to eq(
|
43
|
+
expect(record.errors.messages).to eq(ratings: ["REQUIRED_PROPERTY_VALUE"], recommended: ["REQUIRED_PROPERTY_VALUE"])
|
46
44
|
expect(record.errors.message).to eq error_message
|
47
45
|
end
|
48
46
|
|
49
47
|
it 'doesnt fail when no fields are provided by the backend' do
|
50
48
|
stub_request(:post, "#{datastore}/feedbacks")
|
51
|
-
|
49
|
+
.to_return(status: 400, body: {}.to_json)
|
52
50
|
Record.create(name: 'Steve')
|
53
51
|
end
|
54
52
|
end
|
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
|
-
|
5
4
|
context 'definitions' do
|
6
|
-
|
7
5
|
let(:datastore) { 'http://local.ch/v2' }
|
8
6
|
|
9
7
|
before(:each) do
|
@@ -21,7 +19,7 @@ describe LHS::Record do
|
|
21
19
|
end
|
22
20
|
end
|
23
21
|
stub_request(:get, "#{datastore}/local-entries/1")
|
24
|
-
.to_return(status: 200, body: {addresses: [{business: {identities: [{name: 'Löwenzorn'}]}}]}.to_json)
|
22
|
+
.to_return(status: 200, body: { addresses: [{ business: { identities: [{ name: 'Löwenzorn' }] } }] }.to_json)
|
25
23
|
entry = LocalEntry.find(1)
|
26
24
|
expect(entry.name).to eq 'Löwenzorn'
|
27
25
|
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Record do
|
4
|
-
|
5
4
|
context 'misconfiguration of endpoints' do
|
6
|
-
|
7
5
|
it 'fails trying to add clashing endpoints' do
|
8
6
|
expect(
|
9
|
-
|
7
|
+
lambda {
|
10
8
|
class Record < LHS::Record
|
11
9
|
endpoint ':datastore/v2/feedbacks'
|
12
10
|
endpoint ':datastore/v2/reviews'
|
@@ -14,7 +12,7 @@ describe LHS::Record do
|
|
14
12
|
}
|
15
13
|
).to raise_error('Clashing endpoints.')
|
16
14
|
expect(
|
17
|
-
|
15
|
+
lambda {
|
18
16
|
class Record < LHS::Record
|
19
17
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
20
18
|
endpoint ':datastore/v2/:campaign_id/reviews'
|