Sha256: f44d773d3db03c31c7ca199a1810f2bf5a28e7a863a73bd44fa465dbba04eda1
Contents?: true
Size: 841 Bytes
Versions: 9
Compression:
Stored size: 841 Bytes
Contents
require 'rails_helper' module Logistics module Core RSpec.describe UnitService do describe '#convert_unit' do it 'converts to quintal' do create(:unit, abbreviation: 'qt', name: 'Quintal', rate_to_base: 1) create(:unit, abbreviation: 'kg', name: 'Kilogram', rate_to_base: 5) unit_service = UnitService.new converted = unit_service.convert_unit(20, 'kg') expect(converted).to eq 4 end it 'converts from quintal' do create(:unit, abbreviation: 'qt', name: 'Quintal', rate_to_base: 1) create(:unit, abbreviation: 'kg', name: 'Kilogram', rate_to_base: 5) unit_service = UnitService.new converted = unit_service.convert_unit(6, 'kg', false) expect(converted).to eq 30 end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems