Skip to content

Commit

Permalink
Merge pull request #4641 from sanger/y24-382-add-test-cases
Browse files Browse the repository at this point in the history
Y24-382: add example test cases
  • Loading branch information
StephenHulme authored Feb 11, 2025
2 parents bd384c8 + d1f1c5b commit bf13288
Show file tree
Hide file tree
Showing 2 changed files with 380 additions and 65 deletions.
23 changes: 23 additions & 0 deletions spec/models/well_attribute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,27 @@
)
expect(Warren.handler.messages_matching("queue_broadcast.messenger.#{warehouse_message.id}")).to be 2
end

describe '#estimated_volume' do
it 'returns the estimated volume as a float' do
well_attribute.current_volume = 10
expect(well_attribute.estimated_volume).to be_a(Float)
end

it 'returns the estimated volume as the measured volume if both are set' do
well_attribute.current_volume = 10
well_attribute.measured_volume = 20
expect(well_attribute.estimated_volume).to eq 20.0
end

it 'returns the current volume if the measured volume is not set' do
well_attribute.current_volume = 10
expect(well_attribute.estimated_volume).to eq 10.0
end

it 'returns the measured volume if the current volume is not set' do
well_attribute.measured_volume = 20
expect(well_attribute.estimated_volume).to eq 20.0
end
end
end
Loading

0 comments on commit bf13288

Please sign in to comment.