her 1.0.0 → 1.0.1
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: 109d53a5d927fd7ee67674af4b5944f06c2c6de4
|
4
|
+
data.tar.gz: cef631d95fa6b495bd92c354e5a9122d296b42a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e229413c7297cd7c5864880d6a98658fd194eb2deac87724841e4bc6f58dfa7a7a42056d092a9250f0f99506a4e6d67051ce63f2970d0e1281ac881b37bc587
|
7
|
+
data.tar.gz: b5fb836f54c4fbd89c201f4a213078900357eb0dfe57e3977ff2966daec1c5e7a7a0236d016bb055a45ce8a1d342e3d4dcdbd217ce7fe5cb8887a122f343efe5
|
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: 1.0.
|
4
|
+
version: 1.0.1
|
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
|