Sha256: e3237e07d4a274a345f081e7cfbf26171364f583f845c015389b7f727ea4518e

Contents?: true

Size: 1.2 KB

Versions: 18

Compression:

Stored size: 1.2 KB

Contents

require "spec_helper"
require "fog/brightbox/models/compute/load_balancer"

describe Fog::Brightbox::Compute::LoadBalancer do
  include ModelSetup
  include SupportsResourceLocking

  subject { service.load_balancers.new }

  describe "when asked for collection name" do
    it "responds 'load_balancers'" do
      assert_equal "load_balancers", subject.collection_name
    end
  end

  describe "when asked for resource name" do
    it "responds 'load_balancer'" do
      assert_equal "load_balancer", subject.resource_name
    end
  end

  describe "when creating" do
    it "send correct JSON" do
      options = {
        healthcheck: {},
        listeners: [
          {
            protocol: "http",
            in: 80,
            out: 80
          }
        ],
        nodes: []
      }

      stub_request(:post, "http://localhost/1.0/load_balancers").
        with(:query => hash_including(:account_id),
             :headers => { "Authorization" => "Bearer FAKECACHEDTOKEN" }).
        to_return(:status => 202, :body => %q({"id": "lba-12345"}), :headers => {})

      @load_balancer = Fog::Brightbox::Compute::LoadBalancer.new({ :service => service }.merge(options))
      assert @load_balancer.save
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fog-brightbox-1.10.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.9.1 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.9.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.8.2 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.8.1 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.8.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.7.3 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.7.2 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.7.1 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.7.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.6.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.5.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.5.0.rc1 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.4.2 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.4.1 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.4.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.3.0 spec/fog/compute/brightbox/load_balancer_spec.rb
fog-brightbox-1.2.0 spec/fog/compute/brightbox/load_balancer_spec.rb