diff --git a/spec/unit/coinbase/address_spec.rb b/spec/unit/coinbase/address_spec.rb index fe190e0c..b8739cdf 100644 --- a/spec/unit/coinbase/address_spec.rb +++ b/spec/unit/coinbase/address_spec.rb @@ -28,6 +28,23 @@ 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 'does not include reputation score' do + is_expected.not_to include('reputation_score') + end + 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