spec/lib/comfan_spec.rb in comfan-0.1.0 vs spec/lib/comfan_spec.rb in comfan-0.1.1
- old
+ new
@@ -13,10 +13,14 @@
it 'returns the correct API ID for UI ID' do
input = '752S00000000Ktk'
output = '752S00000000KtkIAE'
expect(subject.api_id(input)).to eq(output)
end
+
+ it 'returns nil for nil input' do
+ expect(subject.api_id(nil)).to be_nil
+ end
end
describe '.ui_id' do
it 'returns the same ID for UI ID' do
input = '752S00000000Ktk'
@@ -25,8 +29,12 @@
it 'returns the correct UI ID for API ID' do
input = '752S00000000KtkIAE'
output = '752S00000000Ktk'
expect(subject.ui_id(input)).to eq(output)
+ end
+
+ it 'returns nil for nil input' do
+ expect(subject.ui_id(nil)).to be_nil
end
end
end
\ No newline at end of file