spec/webmachine/request_spec.rb in webmachine-0.4.1 vs spec/webmachine/request_spec.rb in webmachine-0.4.2
- old
+ new
@@ -27,10 +27,15 @@
it "should provide a hash of query parameters" do
subject.uri.query = "foo=bar&baz=bam"
subject.query.should == {"foo" => "bar", "baz" => "bam"}
end
+ it "should handle = being encoded as a query value." do
+ subject.uri.query = "foo=bar%3D%3D"
+ subject.query.should == { "foo" => "bar=="}
+ end
+
it "should treat '+' characters in query parameters as spaces" do
subject.uri.query = "a%20b=foo+bar&c+d=baz%20quux"
subject.query.should == {"a b" => "foo bar", "c d" => "baz quux"}
end
@@ -45,11 +50,11 @@
context "when the request was issued via HTTPS" do
let(:uri) { URI.parse("https://localhost.com:8080/some/resource") }
it { should be_true }
end
-
+
context "when the request was not issued via HTTPS" do
let(:uri) { URI.parse("http://localhost.com:8080/some/resource") }
it { should be_false }
end
@@ -61,11 +66,11 @@
context "when the request method is GET" do
let(:http_method) { "GET" }
it { should be_true }
end
-
+
context "when the request method is not GET" do
let(:http_method) { "POST" }
it { should be_false }
end
@@ -77,11 +82,11 @@
context "when the request method is HEAD" do
let(:http_method) { "HEAD" }
it { should be_true }
end
-
+
context "when the request method is not HEAD" do
let(:http_method) { "GET" }
it { should be_false }
end
@@ -93,11 +98,11 @@
context "when the request method is POST" do
let(:http_method) { "POST" }
it { should be_true }
end
-
+
context "when the request method is not POST" do
let(:http_method) { "GET" }
it { should be_false }
end
@@ -109,11 +114,11 @@
context "when the request method is PUT" do
let(:http_method) { "PUT" }
it { should be_true }
end
-
+
context "when the request method is not PUT" do
let(:http_method) { "GET" }
it { should be_false }
end
@@ -125,11 +130,11 @@
context "when the request method is DELETE" do
let(:http_method) { "DELETE" }
it { should be_true }
end
-
+
context "when the request method is not DELETE" do
let(:http_method) { "GET" }
it { should be_false }
end
@@ -141,11 +146,11 @@
context "when the request method is TRACE" do
let(:http_method) { "TRACE" }
it { should be_true }
end
-
+
context "when the request method is not TRACE" do
let(:http_method) { "GET" }
it { should be_false }
end
@@ -157,11 +162,11 @@
context "when the request method is CONNECT" do
let(:http_method) { "CONNECT" }
it { should be_true }
end
-
+
context "when the request method is not CONNECT" do
let(:http_method) { "GET" }
it { should be_false }
end
@@ -173,10 +178,10 @@
context "when the request method is OPTIONS" do
let(:http_method) { "OPTIONS" }
it { should be_true }
end
-
+
context "when the request method is not OPTIONS" do
let(:http_method) { "GET" }
it { should be_false }
end