roar 0.12.6 → 0.12.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.markdown +4 -0
- data/lib/roar/representer/feature/hypermedia.rb +1 -1
- data/lib/roar/version.rb +1 -1
- data/test/hypermedia_test.rb +11 -1
- 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: f83dc6d5009e6fee594a68ec001885cd1fe34633
|
4
|
+
data.tar.gz: 5e82fb1a251205d78898f1609d1fa992e8c0dbb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef5c2c6fe33df422ee672250b5bd482aaa56bace33debdd1ae842ad2878e3a8cbb5a85da35308653952f3bf83734f98520a187b2e3751c06bf1586ad5d613e21
|
7
|
+
data.tar.gz: e8e31d4672aad7bd3470c49e640cae28aebfaa3541b4ab14ea25f2bb9b29084a84f2c4d817a3da9cee1dd2b01deb991b45713244d973ae50207b53844e777bdf
|
data/CHANGES.markdown
CHANGED
data/lib/roar/version.rb
CHANGED
data/test/hypermedia_test.rb
CHANGED
@@ -107,10 +107,20 @@ class HypermediaTest < MiniTest::Spec
|
|
107
107
|
describe "returning option hash from block" do
|
108
108
|
representer_for do
|
109
109
|
link(:self) do {:href => "//self", :type => "image/jpg"} end
|
110
|
+
link(:other) do |params|
|
111
|
+
hash = { :href => "//other" }
|
112
|
+
hash.merge!(:type => 'image/jpg') if params[:type]
|
113
|
+
hash
|
114
|
+
end
|
110
115
|
end
|
111
116
|
|
112
117
|
it "is rendered as link attributes" do
|
113
|
-
subject.to_json.must_equal "{\"links\":[{\"rel\":\"self\",\"href\":\"//self\",\"type\":\"image/jpg\"}]}"
|
118
|
+
subject.to_json.must_equal "{\"links\":[{\"rel\":\"self\",\"href\":\"//self\",\"type\":\"image/jpg\"},{\"rel\":\"other\",\"href\":\"//other\"}]}"
|
119
|
+
end
|
120
|
+
|
121
|
+
it "is rendered according to context" do
|
122
|
+
subject.to_json(type: true).must_equal "{\"links\":[{\"rel\":\"self\",\"href\":\"//self\",\"type\":\"image/jpg\"},{\"rel\":\"other\",\"href\":\"//other\",\"type\":\"image/jpg\"}]}"
|
123
|
+
subject.to_json.must_equal "{\"links\":[{\"rel\":\"self\",\"href\":\"//self\",\"type\":\"image/jpg\"},{\"rel\":\"other\",\"href\":\"//other\"}]}"
|
114
124
|
end
|
115
125
|
end
|
116
126
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: representable
|