spec/shelly/client_spec.rb in shelly-0.0.30 vs spec/shelly/client_spec.rb in shelly-0.0.31

- old
+ new

@@ -98,17 +98,43 @@ @client.should_receive(:get).with("/token") @client.token end end - describe "#cloud_logs" do + describe "#deploy_logs" do it "should send get request" do time = Time.now FakeWeb.register_uri(:get, @url + "/apps/staging-foo/deploys", :body => [{:failed => false, :created_at => time}, {:failed => true, :created_at => time+1}].to_json) - response = @client.cloud_logs("staging-foo") + response = @client.deploy_logs("staging-foo") response.should == [{"failed"=>false, "created_at"=>time.to_s}, {"failed"=>true, "created_at"=>(time+1).to_s}] + end + end + + describe "#deploy_log" do + it "should send get request with cloud and log" do + FakeWeb.register_uri(:get, @url + "/apps/staging-foo/deploys/2011-11-29-11-50-16", :body => {:content => "Log"}.to_json) + response = @client.deploy_log("staging-foo", "2011-11-29-11-50-16") + response.should == {"content" => "Log"} + end + end + + describe "#app_configs" do + it "should send get request" do + FakeWeb.register_uri(:get, @url + "/apps/staging-foo/configs", :body => [{:created_by_user => true, :path => "config/app.yml"}].to_json) + response = @client.app_configs("staging-foo") + response.should == [{"created_by_user" => true, "path" => "config/app.yml"}] + end + end + + describe "#application_logs" do + it "should send get request" do + time = Time.now + FakeWeb.register_uri(:get, @url + "/apps/staging-foo/logs", + :body => {:logs => ["application_log_1", "application_log_2"]}.to_json) + response = @client.application_logs("staging-foo") + response.should == {"logs" => ["application_log_1", "application_log_2"]} end end describe "#create_app" do it "should send post with app's attributes" do