spec/cfoundry/v2/app_spec.rb in cfoundry-2.0.0 vs spec/cfoundry/v2/app_spec.rb in cfoundry-2.0.1.rc1

- old
+ new

@@ -139,11 +139,11 @@ end describe "#update!" do describe "changes" do subject { build(:app, :client => client) } - let(:response) { {:body => { "foo" => "bar" }.to_json } } + let(:response) { {:body => {"foo" => "bar"}.to_json} } before do stub(client.base).put("v2", "apps", subject.guid, anything) do response end @@ -248,9 +248,20 @@ it "accepts and ignores an options hash" do mock(client.base).delete("v2", :apps, subject.guid, {:params => {:recursive => true}}) subject.delete!(:recursive => false) + end + + describe "#health" do + describe "when staging failed for an app" do + it "returns 'STAGING FAILED' as state" do + stub(client.base).instances(subject.guid) { raise CFoundry::StagingError } + stub(subject).state { "STARTED" } + + expect(subject.health).to eq("STAGING FAILED") + end + end end end end end