Spec: Test a url helper function (#428)

This commit is contained in:
Olle Jonsson
2016-10-01 19:23:48 +02:00
committed by GitHub
parent 5fde22461e
commit 828d639348
2 changed files with 18 additions and 8 deletions

View File

@@ -426,6 +426,20 @@ describe GitHubChangelogGenerator::OctoFetcher do
end
end
describe "#querystring_as_hash" do
it "works on the blank URL" do
expect { fetcher.send(:querystring_as_hash, "") }.not_to raise_error
end
it "where there are no querystring params" do
expect { fetcher.send(:querystring_as_hash, "http://example.com") }.not_to raise_error
end
it "returns a String-keyed Hash of querystring params" do
expect(fetcher.send(:querystring_as_hash, "http://example.com/o.html?str=18&wis=12")).to include("wis" => "12", "str" => "18")
end
end
describe "#fetch_commit" do
context "when API call is valid", :vcr do
it "returns commit" do