Sha256: 5ea9fe8c6ea637946c210a1fdef80a1988255da7be380f9b5c396e608c489c0b
Contents?: true
Size: 1.83 KB
Versions: 2
Compression:
Stored size: 1.83 KB
Contents
require 'spec_helper' describe EY::CloudClient::App do describe ".all" do it "hits the index action in the API" do response = { "apps" => [ { "environments"=>[], "name"=>"myapp", "repository_uri"=>"git@github.com:myaccount/myapp.git", "account"=>{"name"=>"myaccount", "id"=>1234}, "id"=>12345 } ] } FakeWeb.register_uri(:get, "https://cloud.engineyard.com/api/v2/apps?no_instances=true", :body => MultiJson.dump(response), :content_type => "application/json") apps = EY::CloudClient::App.all(cloud_client) apps.length.should == 1 apps.first.name.should == "myapp" end end describe ".create" do it "hits the create app action in the API" do account = EY::CloudClient::Account.new(cloud_client, {:id => 1234, :name => 'myaccount'}) response = { "app"=>{ "environments"=>[], "name"=>"myapp", "repository_uri"=>"git@github.com:myaccount/myapp.git", "account"=>{"name"=>"myaccount", "id"=>1234}, "id"=>12345 } } FakeWeb.register_uri(:post, "https://cloud.engineyard.com/api/v2/accounts/1234/apps", :body => MultiJson.dump(response), :content_type => "application/json") app = EY::CloudClient::App.create(cloud_client, { "account" => account, "name" => 'myapp', "repository_uri" => 'git@github.com:myaccount/myapp.git', "app_type_id" => 'rails3' }) FakeWeb.should have_requested(:post, "https://cloud.engineyard.com/api/v2/accounts/1234/apps") app.name.should == "myapp" app.account.name.should == "myaccount" end end describe "#destroy" do it "hits the destroy action in the API" do pending end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
engineyard-cloud-client-1.0.10 | spec/engineyard-cloud-client/models/app_spec.rb |
engineyard-cloud-client-1.0.9 | spec/engineyard-cloud-client/models/app_spec.rb |