Sha256: 6783b2a7376129b4a50f4186269f24a85867cbfb8553b5ff1531a7a40ab615e2

Contents?: true

Size: 884 Bytes

Versions: 45

Compression:

Stored size: 884 Bytes

Contents

require "spec_helper"

describe Brightbox::FirewallRule do
  before do
    config_from_contents(API_CLIENT_CONFIG_CONTENTS)
  end

  describe "#create" do
    context "when policy exists" do
      before do
        policy_options = {
        }
        @policy = Brightbox::FirewallPolicy.create(policy_options)

        @rule_options = {
          :destination => "0.0.0.0/0",
          :destination_port => "1080",
          :protocol => "tcp",
          :firewall_policy_id => @policy.id
        }
      end

      it "creates the rule successfully", vcr: true do
        @rule = Brightbox::FirewallRule.create(@rule_options)
        output = FauxIO.new do
          Brightbox.render_table([@rule], :vertical => true)
        end

        expect(output.stdout).to include(@rule.id)
      end

      after do
        @rule.destroy
        @policy.destroy
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-3.3.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-3.2.0 spec/unit/brightbox/firewall_rule/create_spec.rb
brightbox-cli-3.1.0 spec/unit/brightbox/firewall_rule/create_spec.rb