spec/shelly/app_spec.rb in shelly-0.0.30 vs spec/shelly/app_spec.rb in shelly-0.0.31
- old
+ new
@@ -46,10 +46,27 @@
@app.should_receive(:system).with("git remote add production git@git.shellycloud.com:foo-staging.git")
@app.add_git_remote
end
end
+ describe "#configs" do
+ it "should get configs from client" do
+ @client.should_receive(:app_configs).with("foo-staging")
+ @app.configs
+ end
+
+ it "should return only user config files" do
+ @client.should_receive(:app_configs).with("foo-staging").and_return([])
+ @app.user_configs
+ end
+
+ it "should return only shelly genereted config files" do
+ @client.should_receive(:app_configs).with("foo-staging").and_return([])
+ @app.shelly_generated_configs
+ end
+ end
+
describe "#generate_cloudfile" do
it "should return generated cloudfile" do
user = mock(:email => "bob@example.com")
@app.stub(:current_user).and_return(user)
@app.databases = %w(postgresql mongodb)
@@ -126,13 +143,28 @@
@client.should_receive(:stop_cloud).with("foo-staging")
@app.stop
end
end
- describe "#logs" do
- it "should list logs" do
- @client.should_receive(:cloud_logs).with("foo-staging")
- @app.logs
+ describe "#deploy_logs" do
+ it "should list deploy_logs" do
+ @client.should_receive(:deploy_logs).with("foo-staging")
+ @app.deploy_logs
+ end
+ end
+
+ describe "#application_logs" do
+ it "should list application_logs" do
+ @client.should_receive(:application_logs).with("foo-staging").
+ and_return({"logs" => ["log1", "log2"]})
+ @app.application_logs
+ end
+ end
+
+ describe "#deploy_log" do
+ it "should show log" do
+ @client.should_receive(:deploy_log).with("foo-staging", "2011-11-29-11-50-16")
+ @app.deploy_log("2011-11-29-11-50-16")
end
end
describe "#create" do
context "without providing domain" do