diff options
| author | Luke Kanies <luke@madstop.com> | 2009-02-19 16:09:58 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2009-02-19 17:51:22 -0600 |
| commit | 262937ff6e505bbf86d15500279ff23398f9e1c8 (patch) | |
| tree | 66084a1e14ed86f19982b800f60d332c139c8a36 /spec/unit/file_serving | |
| parent | b800bde30bd5a08f5e222725588062e2bca37a79 (diff) | |
| download | puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.tar.gz puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.tar.xz puppet-262937ff6e505bbf86d15500279ff23398f9e1c8.zip | |
Correctly handling URI escaping throughout the REST process
This means, at the least, that we can now serve files
via REST when they have spaces and other weird characters
in their names.
This involves a small change to many files.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/file_serving')
| -rwxr-xr-x | spec/unit/file_serving/configuration.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/file_serving/configuration.rb b/spec/unit/file_serving/configuration.rb index c2d2e5014..e62423caf 100755 --- a/spec/unit/file_serving/configuration.rb +++ b/spec/unit/file_serving/configuration.rb @@ -134,7 +134,7 @@ describe Puppet::FileServing::Configuration do @config = Puppet::FileServing::Configuration.create @config.stubs(:find_mount) - @request = stub 'request', :key => "puppet:///foo/bar/baz", :options => {} + @request = stub 'request', :key => "foo/bar/baz", :options => {} end it "should reread the configuration" do @@ -150,13 +150,13 @@ describe Puppet::FileServing::Configuration do end it "should fail if the mount name is not alpha-numeric" do - @request.expects(:key).returns "puppet:///foo&bar/asdf" + @request.expects(:key).returns "foo&bar/asdf" lambda { @config.split_path(@request) }.should raise_error(ArgumentError) end it "should support dashes in the mount name" do - @request.expects(:key).returns "puppet:///foo-bar/asdf" + @request.expects(:key).returns "foo-bar/asdf" lambda { @config.split_path(@request) }.should_not raise_error(ArgumentError) end @@ -182,7 +182,7 @@ describe Puppet::FileServing::Configuration do end it "should remove any double slashes" do - @request.stubs(:key).returns "puppet:///foo/bar//baz" + @request.stubs(:key).returns "foo/bar//baz" mount = stub 'mount', :name => "foo" @config.expects(:find_mount).returns mount @@ -190,7 +190,7 @@ describe Puppet::FileServing::Configuration do end it "should return the relative path as nil if it is an empty string" do - @request.expects(:key).returns "puppet:///foo" + @request.expects(:key).returns "foo" mount = stub 'mount', :name => "foo" @config.expects(:find_mount).returns mount @@ -198,7 +198,7 @@ describe Puppet::FileServing::Configuration do end it "should add 'modules/' to the relative path if the modules mount is used but not specified, for backward compatibility" do - @request.expects(:key).returns "puppet:///foo/bar" + @request.expects(:key).returns "foo/bar" mount = stub 'mount', :name => "modules" @config.expects(:find_mount).returns mount |
