Sha256: f93e9e675a6f64346cfb816f9047157be20f02a100ef1971b6de10359c2508eb

Contents?: true

Size: 1.76 KB

Versions: 41

Compression:

Stored size: 1.76 KB

Contents

require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')

if Fog.mocking?
  #FIXME: with rspec2
  describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
    subject { @vcloud }

    it { should respond_to :add_node }

    describe "#add_node" do

      let(:new_node_data) { { :ip_address  => '1.2.3.4',
                              :name        => 'Foo',
                              :port        => '9090',
                              :enabled     => 'true',
                              :description => 'Foo Service'
                            } }

      context "with a valid node services uri" do

        subject { @vcloud.add_node(@mock_service[:href] + "/nodeServices", new_node_data) }

        it_should_behave_like "all responses"

        let(:service) { @vcloud.vdcs.first.public_ips.first.internet_services.first }

        it "should change the count by 1" do
          service.nodes.length.should == 2
          subject
          service.nodes.reload.length.should == 3
        end

        describe "#body" do
          subject { @vcloud.add_node(@mock_service[:href] + "/nodeServices", new_node_data).body }
          its(:Enabled) { should == new_node_data[:enabled] }
          its(:Port) { should == new_node_data[:port] }
          its(:IpAddress) { should == new_node_data[:ip_address] }
          its(:Name) { should == new_node_data[:name] }
          its(:Description) { should == new_node_data[:description] }
        end
      end

      context "with a nodes uri that doesn't exist" do
        subject { lambda { @vcloud.add_node(URI.parse('https://www.fakey.c/piv8vc99'), new_node_data ) } }

        it_should_behave_like "a request for a resource that doesn't exist"
      end
    end
  end
else
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
fog-0.3.16 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.15 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.14 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.13 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.12 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.11 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.10 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.9 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.8 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.7 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.6 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.5 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.4 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.3 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.2 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.1 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.3.0 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.2.30 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.2.28 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb
fog-0.2.27 spec/vcloud/terremark/ecloud/requests/add_node_spec.rb