File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ def url
417
417
if @attrs [ 'self' ]
418
418
@attrs [ 'self' ]
419
419
elsif key_value
420
- self . class . singular_path ( client , key_value . to_s , prefix )
420
+ self . class . singular_path ( client , URI . encode ( key_value . to_s ) , prefix )
421
421
else
422
422
self . class . collection_path ( client , prefix )
423
423
end
Original file line number Diff line number Diff line change @@ -334,6 +334,12 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc:
334
334
attrs [ 'id' ] = '98765'
335
335
subject . url . should == "/foo/bar/deadbeef/98765"
336
336
end
337
+
338
+ it "generates the encoded URL from key value" do
339
+ attrs [ 'self' ] = nil
340
+ attrs [ 'id' ] = 'foo bar'
341
+ subject . url . should == "/foo/bar/deadbeef/foo%20bar"
342
+ end
337
343
338
344
it "generates the URL from collection_path if self and id not set" do
339
345
attrs [ 'self' ] = nil
You can’t perform that action at this time.
0 commit comments