Sha256: 55bbb180ed6a1a8f01417f25f973a1a2dd2d4c227098c5e5780287bd8b5b263b
Contents?: true
Size: 1.07 KB
Versions: 9
Compression:
Stored size: 1.07 KB
Contents
require "spec_helper" describe Aitch::URI do it "returns default path" do expect(Aitch::URI.new("http://example.org").path).to eql("/") end it "returns defined path" do expect(Aitch::URI.new("http://example.org/some/path").path).to eql("/some/path") end it "returns fragment" do expect(Aitch::URI.new("http://example.org/#top").fragment).to eql("#top") end it "returns query string" do expect(Aitch::URI.new("http://example.org/?a=1&b=2").query).to eql("?a=1&b=2") end it "converts data into query string" do expect(Aitch::URI.new("http://example.org", a: 1, b: 2).query).to eql("?a=1&b=2") end it "merges data into query string" do expect(Aitch::URI.new("http://example.org/?a=1&b=2", c: 3).query).to eql("?a=1&b=2&c=3") end it "ignores data when request has body" do expect(Aitch::URI.new("http://example.org/", {c: 3}, true).query).to eql(nil) end it "returns request uri" do uri = Aitch::URI.new("http://example.org/some/path?a=1&b=2#hello", c: 3) expect(uri.request_uri).to eql("/some/path?a=1&b=2&c=3#hello") end end
Version data entries
9 entries across 9 versions & 1 rubygems