File tree 2 files changed +26
-1
lines changed
2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
s . summary = 'Build client libraries compliant with specification defined by jsonapi.org'
13
13
14
14
s . add_dependency "activesupport" , '>= 3.2.0'
15
- s . add_dependency "faraday" , '~> 0.9'
15
+ s . add_dependency "faraday" , [ '~> 0.15' , '>= 0.15.2' ]
16
16
s . add_dependency "faraday_middleware" , '~> 0.9'
17
17
s . add_dependency "addressable" , '~> 2.2'
18
18
s . add_dependency "activemodel" , '>= 3.2.0'
Original file line number Diff line number Diff line change @@ -169,4 +169,29 @@ def test_can_select_nested_fields_using_comma_separated_strings
169
169
Article . select ( { comments : 'author,text' } , :tags ) . to_a
170
170
end
171
171
172
+ def test_can_specify_array_filter_value
173
+ stub_request ( :get , "http://example.com/articles?filter%5Bauthor.id%5D%5B0%5D=foo&filter%5Bauthor.id%5D%5B1%5D=bar" )
174
+ . to_return ( headers : { content_type : "application/vnd.api+json" } , body : {
175
+ data : [ ]
176
+ } . to_json )
177
+ Article . where ( :'author.id' => [ 'foo' , 'bar' ] ) . to_a
178
+ end
179
+
180
+ def test_can_specify_empty_array_filter_value
181
+ stub_request ( :get , "http://example.com/articles?filter%5Bauthor.id%5D%5B0%5D" )
182
+ . to_return ( headers : { content_type : "application/vnd.api+json" } , body : {
183
+ data : [ ]
184
+ } . to_json )
185
+ Article . where ( :'author.id' => [ ] ) . to_a
186
+ end
187
+
188
+ def test_can_specify_empty_string_filter_value
189
+ stub_request ( :get , "http://example.com/articles" )
190
+ . with ( query : { filter : { :'author.id' => '' } } )
191
+ . to_return ( headers : { content_type : "application/vnd.api+json" } , body : {
192
+ data : [ ]
193
+ } . to_json )
194
+ Article . where ( :'author.id' => '' ) . to_a
195
+ end
196
+
172
197
end
You can’t perform that action at this time.
0 commit comments