Escape slash in database name
This commit is contained in:
parent
4337e676ee
commit
190bd13723
|
@ -17,7 +17,7 @@ module CouchRest
|
|||
@name = name
|
||||
@server = server
|
||||
@host = server.uri
|
||||
@uri = @root = "#{host}/#{name}"
|
||||
@uri = @root = "#{host}/#{name.gsub('/','%2F')}"
|
||||
@streamer = Streamer.new(self)
|
||||
@bulk_save_cache = []
|
||||
@bulk_save_cache_limit = 500 # must be smaller than the uuid count
|
||||
|
|
|
@ -8,6 +8,14 @@ describe CouchRest::Database do
|
|||
@db = @cr.create_db(TESTDB) rescue nil
|
||||
end
|
||||
|
||||
describe "database name including slash" do
|
||||
it "should escape the name in the URI" do
|
||||
db = @cr.database("foo/bar")
|
||||
db.name.should == "foo/bar"
|
||||
db.uri.should == "#{COUCHHOST}/foo%2Fbar"
|
||||
end
|
||||
end
|
||||
|
||||
describe "map query with _temp_view in Javascript" do
|
||||
before(:each) do
|
||||
@db.bulk_save([
|
||||
|
|
Loading…
Reference in a new issue