mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Handle ugly url targets
This commit is contained in:
@@ -14,7 +14,7 @@ describe UriAdapter do
|
||||
describe "#initialize" do
|
||||
|
||||
it "has a target" do
|
||||
subject.target.should be_instance_of(URI::HTTP)
|
||||
subject.target.should be_instance_of(Addressable::URI)
|
||||
end
|
||||
|
||||
it "has content" do
|
||||
@@ -29,6 +29,27 @@ describe UriAdapter do
|
||||
subject.tempfile.should be_instance_of Tempfile
|
||||
end
|
||||
|
||||
describe "it handles ugly targets" do
|
||||
let(:ugly_target) { "http://cdn.discourse.org/assets/logo with spaces.png" }
|
||||
subject { UriAdapter.new(ugly_target) }
|
||||
|
||||
it "handles targets" do
|
||||
subject.target.should be_instance_of(Addressable::URI)
|
||||
end
|
||||
|
||||
it "has content" do
|
||||
subject.content.should == response
|
||||
end
|
||||
|
||||
it "has an original_filename" do
|
||||
subject.original_filename.should == "logo with spaces.png"
|
||||
end
|
||||
|
||||
it "has a tempfile" do
|
||||
subject.tempfile.should be_instance_of Tempfile
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe "#copy_to_tempfile" do
|
||||
|
||||
Reference in New Issue
Block a user