spec/shelly/client_spec.rb in shelly-0.0.46.pre3 vs spec/shelly/client_spec.rb in shelly-0.0.46.pre4
- old
+ new
@@ -186,14 +186,14 @@
response = @client.app("staging-foo")
response.should == {"web_server_ip" => "192.0.2.1", "mail_server_ip" => "192.0.2.3"}
end
end
- describe "#run" do
- it "should send post request with app code_name and code" do
- FakeWeb.register_uri(:post, api_url("apps/staging-foo/run"),
- :body => {:result => "4"}.to_json)
- response = @client.run("staging-foo", "2 + 2")
+ describe "#command" do
+ it "should send post request with app code_name, body and type" do
+ @client.should_receive(:post).with("/apps/staging-foo/command",
+ {:body => "2 + 2", :type => :ruby}).and_return({"result" => "4"})
+ response = @client.command("staging-foo", "2 + 2", :ruby)
response.should == {"result" => "4"}
end
end
describe "#send_invitation" do