spec/cfoundry/v2/domain_spec.rb in cfoundry-2.3.0 vs spec/cfoundry/v2/domain_spec.rb in cfoundry-2.3.1
- old
+ new
@@ -8,9 +8,21 @@
it "should have a spaces association" do
expect(domain.spaces).to eq([space])
end
+ describe "#owning_organization" do
+ context "when the domain is not persisted" do
+ let(:client) { build(:client) }
+ let(:domain) { build(:domain, client: client, guid: nil)}
+ it "asdf" do
+ client.should_not_receive(:owning_organization)
+ client.should_receive(:organization)
+ domain.owning_organization
+ end
+ end
+ end
+
describe "validations" do
subject { build(:domain) }
it { should validate_presence_of(:name) }
it { should allow_value("run.pivotal.io").for(:name) }
it { should_not allow_value("not-a-url").for(:name) }