spec/shelly/client_spec.rb in shelly-0.4.26 vs spec/shelly/client_spec.rb in shelly-0.4.27
- old
+ new
@@ -466,13 +466,25 @@
it "should not include user credentials when they are blank" do
FileUtils.rm("~/.netrc")
expected = {
:method => :get,
:url => "#{@client.api_url}/account",
- :headers => @client.headers,
- :payload => {}.to_json
+ :headers => @client.headers
}
@client.request_parameters("/account", :get).should == expected
+ end
+
+ [:get, :head].each do |method|
+ it "should not include payload when method is #{method}" do
+ expected = {
+ :method => method,
+ :url => "#{@client.api_url}/account",
+ :headers => @client.headers,
+ :user => "bob@example.com",
+ :password => "123123"
+ }
+ @client.request_parameters("/account", method, :name => "bob").should == expected
+ end
end
end
describe "#request" do
it "should get request parameters" do