Skip to content

Commit

Permalink
Merge branch 'master' into fix_wrong_ipaddress_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
thde authored Feb 12, 2021
2 parents 77ab597 + 388f5bf commit c5852a3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/netbox_client_ruby/api/circuits/circuit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class Circuit

object_fields(
provider: proc do |raw_data|
Circuit::CircuitProvider.new raw_data['id']
Provider.new raw_data['id']
end,
status: proc do |raw_status|
STATUS_VALUES.key(raw_status['value']) || raw_status['value']
end,
type: proc { |raw_data| Circuit::CircuitType.new raw_data['id'] },
type: proc { |raw_data| CircuitType.new raw_data['id'] },
tenant: proc { |raw_data| Tenancy::Tenant.new raw_data['id'] }
)
end
Expand Down
16 changes: 16 additions & 0 deletions spec/netbox_client_ruby/api/circuits/circuit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ module Circuits
end
end

describe '.provider' do
it 'should be a Provider object' do
provider = subject.provider
expect(provider).to be_a Provider
expect(provider.id).to eq(1)
end
end

describe '.type' do
it 'should be a Type object' do
provider = subject.type
expect(provider).to be_a CircuitType
expect(provider.id).to eq(1)
end
end

describe '.delete' do
let(:request_method) { :delete }
let(:response_status) { 204 }
Expand Down

0 comments on commit c5852a3

Please sign in to comment.