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