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/lib/lhs/version.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Collection do
|
4
|
-
|
5
4
|
let(:data) {
|
6
5
|
['ROLE_USER', 'ROLE_LOCALCH_ACCOUNT']
|
7
6
|
}
|
@@ -11,7 +10,6 @@ describe LHS::Collection do
|
|
11
10
|
}
|
12
11
|
|
13
12
|
context 'delegates methods to raw' do
|
14
|
-
|
15
13
|
%w(present? blank? empty?).each do |method|
|
16
14
|
it "delegates #{method} to raw" do
|
17
15
|
expect(collection.send(method.to_sym)).not_to be_nil
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Collection do
|
4
|
-
|
5
4
|
let(:data) {
|
6
5
|
[1, 2, 3]
|
7
6
|
}
|
@@ -11,16 +10,15 @@ describe LHS::Collection do
|
|
11
10
|
}
|
12
11
|
|
13
12
|
context 'enumerable' do
|
14
|
-
|
15
13
|
it 'works with map' do
|
16
14
|
expect(
|
17
|
-
collection.map{|x| x + 1}
|
15
|
+
collection.map { |x| x + 1 }
|
18
16
|
).to eq [2, 3, 4]
|
19
17
|
end
|
20
18
|
|
21
19
|
it 'works with select' do
|
22
20
|
expect(
|
23
|
-
collection.select{|x| x == 2}
|
21
|
+
collection.select { |x| x == 2 }
|
24
22
|
).to eq [2]
|
25
23
|
end
|
26
24
|
end
|
@@ -1,21 +1,19 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
let(:json) do
|
6
5
|
load_json(:feedbacks)
|
7
6
|
end
|
8
7
|
|
9
8
|
let(:data) do
|
10
|
-
|
9
|
+
described_class.new(json)
|
11
10
|
end
|
12
11
|
|
13
12
|
context 'collections' do
|
14
|
-
|
15
13
|
it 'forwards calls to the collection' do
|
16
14
|
expect(data.count).to be_kind_of Fixnum
|
17
|
-
expect(data[0]).to be_kind_of
|
18
|
-
expect(data.sample).to be_kind_of
|
15
|
+
expect(data[0]).to be_kind_of described_class
|
16
|
+
expect(data.sample).to be_kind_of described_class
|
19
17
|
end
|
20
18
|
|
21
19
|
it 'provides a total method to get the number of total records' do
|
@@ -24,9 +22,8 @@ describe LHS::Data do
|
|
24
22
|
end
|
25
23
|
|
26
24
|
context 'collections from arrays' do
|
27
|
-
|
28
25
|
let(:data) do
|
29
|
-
|
26
|
+
described_class.new([1, 2, 3, 4])
|
30
27
|
end
|
31
28
|
|
32
29
|
it 'uses collection as proxy for arrays' do
|
data/spec/data/item_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
@@ -14,7 +13,7 @@ describe LHS::Data do
|
|
14
13
|
end
|
15
14
|
|
16
15
|
let(:data) do
|
17
|
-
|
16
|
+
described_class.new(json, nil, Record)
|
18
17
|
end
|
19
18
|
|
20
19
|
let(:item) do
|
@@ -22,7 +21,6 @@ describe LHS::Data do
|
|
22
21
|
end
|
23
22
|
|
24
23
|
context 'item' do
|
25
|
-
|
26
24
|
it 'makes data accessible' do
|
27
25
|
expect(item.href).to be_kind_of String
|
28
26
|
expect(item.recommended).to be_kind_of TrueClass
|
@@ -33,8 +31,8 @@ describe LHS::Data do
|
|
33
31
|
expect(item.something).to eq nil
|
34
32
|
end
|
35
33
|
|
36
|
-
it 'returns
|
37
|
-
expect(item.created_date).to be_kind_of
|
34
|
+
it 'returns TimeWithZone if string can be parsed as date_time' do
|
35
|
+
expect(item.created_date).to be_kind_of ActiveSupport::TimeWithZone
|
38
36
|
end
|
39
37
|
|
40
38
|
it 'returns date if string can be parsed as date' do
|
data/spec/data/merge_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
@@ -10,20 +9,19 @@ describe LHS::Data do
|
|
10
9
|
end
|
11
10
|
|
12
11
|
let(:data) do
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
described_class.new({
|
13
|
+
href: 'http://www.local.ch/v2/stuff'
|
14
|
+
}, nil, Record)
|
16
15
|
end
|
17
16
|
|
18
17
|
let(:loaded_data) do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
described_class.new({
|
19
|
+
href: 'http://www.local.ch/v2/stuff',
|
20
|
+
id: '123123123'
|
21
|
+
}, nil, Record)
|
23
22
|
end
|
24
23
|
|
25
24
|
context 'merging' do
|
26
|
-
|
27
25
|
it 'merges data' do
|
28
26
|
data.merge_raw!(loaded_data)
|
29
27
|
expect(data.id).to eq loaded_data.id
|
data/spec/data/raw_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/entries/:entry_id/content-ads/:campaign_id/feedbacks'
|
@@ -11,7 +10,7 @@ describe LHS::Data do
|
|
11
10
|
end
|
12
11
|
|
13
12
|
let(:data_from_raw) do
|
14
|
-
|
13
|
+
described_class.new(
|
15
14
|
href: 'http://www.local.ch/v2/stuff',
|
16
15
|
id: '123123123'
|
17
16
|
)
|
@@ -19,12 +18,11 @@ describe LHS::Data do
|
|
19
18
|
|
20
19
|
let(:data_from_item) do
|
21
20
|
raw = { href: 'http://www.local.ch/v2/stuff' }
|
22
|
-
item = LHS::Item.new(
|
23
|
-
|
21
|
+
item = LHS::Item.new(described_class.new(raw))
|
22
|
+
described_class.new(item)
|
24
23
|
end
|
25
24
|
|
26
25
|
context 'raw' do
|
27
|
-
|
28
26
|
it 'you can access raw data that is underlying' do
|
29
27
|
expect(data_from_raw._raw).to be_kind_of Hash
|
30
28
|
end
|
@@ -1,24 +1,22 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
|
-
map :test_mapping?, ->(
|
6
|
+
map :test_mapping?, ->(_item) { true }
|
8
7
|
end
|
9
8
|
end
|
10
9
|
|
11
10
|
context '#respond_to?' do
|
12
|
-
|
13
11
|
it 'it is true for mappings that are defined' do
|
14
|
-
data = described_class.new({'campaign' => {'id' => 123}}, nil, Record)
|
12
|
+
data = described_class.new({ 'campaign' => { 'id' => 123 } }, nil, Record)
|
15
13
|
|
16
14
|
expect(data.respond_to?(:test_mapping?)).to be(true)
|
17
15
|
end
|
18
16
|
|
19
17
|
# proxy for this example is LHC::Collection which implements total
|
20
18
|
it 'it is true for calls forwarded to proxy' do
|
21
|
-
data = described_class.new({'items' => [{'campaign' => {'id' => 123}}]}, nil, Record)
|
19
|
+
data = described_class.new({ 'items' => [{ 'campaign' => { 'id' => 123 } }] }, nil, Record)
|
22
20
|
|
23
21
|
expect(data.respond_to?(:total)).to be(true)
|
24
22
|
end
|
data/spec/data/root_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/entries/:entry_id/content-ads/:campaign_id/feedbacks'
|
@@ -11,14 +10,13 @@ describe LHS::Data do
|
|
11
10
|
end
|
12
11
|
|
13
12
|
context 'root' do
|
14
|
-
|
15
13
|
it 'is navigateable from nested data' do
|
16
|
-
root =
|
14
|
+
root = described_class.new({ 'items' => [{ 'campaign' => { 'id' => 123 } }] }, nil, Record)
|
17
15
|
child = root.first
|
18
16
|
leafe = child.campaign
|
19
17
|
expect(leafe._root).to eq root
|
20
|
-
expect(leafe._parent).to be_kind_of
|
21
|
-
expect(leafe._parent._parent).to be_kind_of
|
18
|
+
expect(leafe._parent).to be_kind_of described_class
|
19
|
+
expect(leafe._parent._parent).to be_kind_of described_class
|
22
20
|
expect(leafe._parent._parent).to eq root
|
23
21
|
end
|
24
22
|
end
|
data/spec/data/select_spec.rb
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
let(:raw) do
|
6
5
|
{ labels: { de: ['cat', 'dog'] } }
|
7
6
|
end
|
8
7
|
|
9
8
|
let(:data) do
|
10
|
-
|
9
|
+
described_class.new(raw)
|
11
10
|
end
|
12
11
|
|
13
12
|
context 'select' do
|
14
|
-
|
15
13
|
it 'works with select' do
|
16
14
|
expect(
|
17
|
-
data.labels.de.select{|x| x}.join
|
15
|
+
data.labels.de.select { |x| x }.join
|
18
16
|
).to eq 'catdog'
|
19
17
|
end
|
20
18
|
end
|
data/spec/data/to_json_spec.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Data do
|
4
|
-
|
5
4
|
before(:each) do
|
6
5
|
class Record < LHS::Record
|
7
6
|
endpoint ':datastore/v2/:campaign_id/feedbacks'
|
@@ -14,7 +13,7 @@ describe LHS::Data do
|
|
14
13
|
end
|
15
14
|
|
16
15
|
let(:collection) do
|
17
|
-
|
16
|
+
described_class.new(json, nil, Record)
|
18
17
|
end
|
19
18
|
|
20
19
|
let(:item) do
|
@@ -23,17 +22,16 @@ describe LHS::Data do
|
|
23
22
|
|
24
23
|
it 'converts item to json' do
|
25
24
|
expect(item.to_json)
|
26
|
-
|
25
|
+
.to eq JSON.parse(load_json(:feedbacks))['items'].first.to_json
|
27
26
|
end
|
28
27
|
|
29
28
|
it 'converts collection to json' do
|
30
29
|
expect(collection.to_json)
|
31
|
-
|
30
|
+
.to eq JSON.parse(load_json(:feedbacks)).to_json
|
32
31
|
end
|
33
32
|
|
34
33
|
it 'converts link to json' do
|
35
34
|
expect(item.campaign.to_json)
|
36
|
-
|
37
|
-
end
|
38
|
-
|
35
|
+
.to eq item.campaign._raw.to_json
|
36
|
+
end
|
39
37
|
end
|
data/spec/dummy/bin/rails
CHANGED
data/spec/dummy/config.ru
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Endpoint do
|
4
|
-
|
5
4
|
context 'for url' do
|
6
|
-
|
7
5
|
before(:each) do
|
8
6
|
class Record < LHS::Record
|
9
7
|
endpoint ':datastore/entries/:entry_id/content-ads/:campaign_id/feedbacks'
|
@@ -14,13 +12,13 @@ describe LHS::Endpoint do
|
|
14
12
|
|
15
13
|
it 'provides the endpoint for a given url' do
|
16
14
|
expect(
|
17
|
-
|
15
|
+
described_class.for_url('http://local.ch/v2/entries/123/content-ads/456/feedbacks').url
|
18
16
|
).to eq ':datastore/entries/:entry_id/content-ads/:campaign_id/feedbacks'
|
19
17
|
expect(
|
20
|
-
|
18
|
+
described_class.for_url('http://local.ch/123/feedbacks').url
|
21
19
|
).to eq ':datastore/:campaign_id/feedbacks'
|
22
20
|
expect(
|
23
|
-
|
21
|
+
described_class.for_url('http://local.ch/feedbacks').url
|
24
22
|
).to eq ':datastore/feedbacks'
|
25
23
|
end
|
26
24
|
end
|
data/spec/item/delegate_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 'delegates methods to raw' do
|
25
|
-
|
26
24
|
%w(present? blank? empty?).each do |method|
|
27
25
|
it "delegates #{method} to raw" do
|
28
26
|
expect(item.send(method.to_sym)).not_to be_nil
|
data/spec/item/destroy_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
|
LHC.config.placeholder('datastore', datastore)
|
7
6
|
class Record < LHS::Record
|
@@ -27,10 +26,9 @@ describe LHS::Item do
|
|
27
26
|
end
|
28
27
|
|
29
28
|
context 'destroy' do
|
30
|
-
|
31
29
|
it 'destroys the item on the backend' do
|
32
30
|
stub_request(:delete, "#{datastore}/v2/feedbacks/0sdaetZ-OWVg4oBiBJ-7IQ")
|
33
|
-
|
31
|
+
.to_return(status: 200)
|
34
32
|
expect(item.destroy._raw).to eq item._raw
|
35
33
|
end
|
36
34
|
|
@@ -51,11 +49,11 @@ describe LHS::Item do
|
|
51
49
|
it 'destroys an item even though it includes additonal services and an empty response body' do
|
52
50
|
stub_request(:delete, "#{datastore}/v2/feedbacks/1")
|
53
51
|
.to_return(status: 204, body: '')
|
54
|
-
data = { href: "#{datastore}/v2/feedbacks/1", restaurant: {href: "#{datastore}/v2/restaurants/1"} }
|
52
|
+
data = { href: "#{datastore}/v2/feedbacks/1", restaurant: { href: "#{datastore}/v2/restaurants/1" } }
|
55
53
|
stub_request(:get, "#{datastore}/v2/feedbacks?id=1")
|
56
54
|
.to_return(status: 200, body: data.to_json)
|
57
55
|
stub_request(:get, "#{datastore}/v2/restaurants/1")
|
58
|
-
.to_return(status: 200, body: {name: 'Casa Ferlin'}.to_json)
|
56
|
+
.to_return(status: 200, body: { name: 'Casa Ferlin' }.to_json)
|
59
57
|
item = Record.includes(:restaurant).find(1)
|
60
58
|
item.destroy
|
61
59
|
end
|
data/spec/item/errors_spec.rb
CHANGED
@@ -1,44 +1,43 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
3
|
describe LHS::Item do
|
4
|
-
|
5
4
|
let(:datastore) { 'http://local.ch/v2' }
|
6
5
|
|
7
6
|
let(:error_format_fields) do
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
7
|
+
{
|
8
|
+
"status" => 400,
|
9
|
+
"message" => "ratings must be set when review or name or review_title is set | The property value is required; it cannot be null, empty, or blank.",
|
10
|
+
"fields" => [
|
11
|
+
{
|
12
|
+
"name" => "ratings",
|
13
|
+
"details" => [{ "code" => "REQUIRED_PROPERTY_VALUE" }, { "code" => "UNSUPPORTED_PROPERTY_VALUE" }]
|
14
|
+
}, {
|
15
|
+
"name" => "recommended",
|
16
|
+
"details" => [{ "code" => "REQUIRED_PROPERTY_VALUE" }]
|
17
|
+
}
|
18
|
+
]
|
19
|
+
}
|
20
|
+
end
|
22
21
|
|
23
22
|
let(:error_format_field_errors) do
|
24
23
|
{
|
25
24
|
"status" => 400,
|
26
25
|
"message" => "Some data in the request body failed validation. Inspect the field errors for details.",
|
27
|
-
"field_errors" => [
|
26
|
+
"field_errors" => [{
|
28
27
|
"code" => "UNSUPPORTED_PROPERTY_VALUE",
|
29
|
-
"path" => [
|
28
|
+
"path" => ["gender"],
|
30
29
|
"message" => "The property value is unsupported. Supported values are: FEMALE, MALE"
|
31
30
|
}, {
|
32
31
|
"code" => "INCOMPLETE_PROPERTY_VALUE",
|
33
|
-
"path" => [
|
32
|
+
"path" => ["gender"],
|
34
33
|
"message" => "The property value is incomplete. It misses some data"
|
35
34
|
}, {
|
36
35
|
"code" => "INCOMPLETE_PROPERTY_VALUE",
|
37
|
-
"path" => [
|
36
|
+
"path" => ["contract", "entry_id"],
|
38
37
|
"message" => "The property value is incomplete. It misses some data"
|
39
|
-
}
|
38
|
+
}]
|
40
39
|
}
|
41
|
-
end
|
40
|
+
end
|
42
41
|
|
43
42
|
before(:each) do
|
44
43
|
LHC.config.placeholder(:datastore, datastore)
|
@@ -49,7 +48,6 @@ describe LHS::Item do
|
|
49
48
|
end
|
50
49
|
|
51
50
|
context 'save failed' do
|
52
|
-
|
53
51
|
it 'parses fields correctly when creation failed' do
|
54
52
|
stub_request(:post, "#{datastore}/feedbacks")
|
55
53
|
.to_return(status: 400, body: error_format_fields.to_json)
|
@@ -81,7 +79,6 @@ describe LHS::Item do
|
|
81
79
|
end
|
82
80
|
|
83
81
|
context 'raw error data' do
|
84
|
-
|
85
82
|
it 'provides access to raw error data' do
|
86
83
|
stub_request(:post, "#{datastore}/feedbacks")
|
87
84
|
.to_return(status: 400, body: error_format_field_errors.to_json)
|