Skip to content

Commit

Permalink
chore: Add unit tests for displaying the address reputation
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-stone committed Dec 13, 2024
1 parent 0acc672 commit 995413d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/unit/coinbase/address_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@
subject { address.to_s }

it { is_expected.to include(network_id.to_s, address_id) }

context 'when the address reputation is not loaded' do
it { is_expected.not_to include('reputation_score') }
end

context 'when the address reputation is loaded' do
let(:score) { 37 }
let(:reputation) { build(:address_reputation, score: score) }

before do
address.instance_variable_set(:@reputation, reputation)
end

it { is_expected.to include('reputation_score', score.to_s) }
end
end

describe '#inspect' do
Expand Down

0 comments on commit 995413d

Please sign in to comment.