her 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/her/model/parse.rb +2 -1
- data/lib/her/version.rb +1 -1
- data/spec/model/parse_spec.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e628f5db6baa8daefe84a2ad28e8d538b4e50b40
|
4
|
+
data.tar.gz: 54e12aa3f8c46c79dc447a18108a135621fd7dc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac64ae278cd0c9927d790a9139e9e7afdd54230c4d54da1e865f8bd729e7742dd511210cce6a9ac8f211977805b38dfe979be88ee5d69684288c0a591128f17c
|
7
|
+
data.tar.gz: 18e8f64882b5a3c7829a102de8e4738bc4b094ae2e773b90077663d91a4db96ea1bda3359168d15c55955a9457c882d0a240d36fc204070eaa53d3a7db1a117c
|
data/lib/her/model/parse.rb
CHANGED
data/lib/her/version.rb
CHANGED
data/spec/model/parse_spec.rb
CHANGED
@@ -493,4 +493,25 @@ describe Her::Model::Parse do
|
|
493
493
|
expect(user.to_params).to eq(model: { name: 'foo' })
|
494
494
|
end
|
495
495
|
end
|
496
|
+
|
497
|
+
context "when attribute uses the same name as root element" do
|
498
|
+
before do
|
499
|
+
Her::API.setup url: "https://api.example.com" do |builder|
|
500
|
+
builder.use Her::Middleware::FirstLevelParseJSON
|
501
|
+
builder.use Faraday::Request::UrlEncoded
|
502
|
+
end
|
503
|
+
|
504
|
+
Her::API.default_api.connection.adapter :test do |stub|
|
505
|
+
stub.post("/users") { |env| [200, {}, { user: "foobar", id: 1, fullname: params(env)[:fullname] }.to_json] }
|
506
|
+
end
|
507
|
+
|
508
|
+
spawn_model "Foo::User"
|
509
|
+
end
|
510
|
+
|
511
|
+
it "parses as attribute instead of root element" do
|
512
|
+
user = Foo::User.create(fullname: "barfoo")
|
513
|
+
expect(user.fullname).to eq "barfoo"
|
514
|
+
expect(user.user).to eq "foobar"
|
515
|
+
end
|
516
|
+
end
|
496
517
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: her
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémi Prévost
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|