spec/fortnox/api/repositories/invoice_spec.rb in fortnox-api-0.7.2 vs spec/fortnox/api/repositories/invoice_spec.rb in fortnox-api-0.8.0
- old
+ new
@@ -35,11 +35,11 @@
:ocr,
'426523791'
# It is not possible to delete Invoces. Therefore, expected nr of Orders
# when running .all will continue to increase (until 100, which is max by default).
- include_examples '.all', 97
+ include_examples '.all', 100
include_examples '.find', 1 do
let(:find_by_hash_failure) { { yourreference: 'Not found' } }
let(:single_param_find_by_hash) do
@@ -127,31 +127,31 @@
end
end
before { persisted_invoice }
- context 'by setting value to nil' do
+ context 'when setting value to nil' do
+ subject { updated_persisted_invoice.comments }
+
let(:updated_persisted_invoice) do
VCR.use_cassette("#{vcr_dir}/save_old_with_nil_comments") do
repository.save(persisted_invoice.update(comments: nil))
end
end
- subject { updated_persisted_invoice.comments }
-
pending { is_expected.to eq(nil) }
end
- context 'by setting value to empty string' do
+ context 'when setting value to empty string' do
+ subject { updated_persisted_invoice.comments }
+
let(:updated_persisted_invoice) do
VCR.use_cassette("#{vcr_dir}/save_old_with_empty_comments") do
repository.save(persisted_invoice.update(comments: ''))
end
end
- subject { updated_persisted_invoice.comments }
-
it 'does not reset the value' do
is_expected.to eq('A comment to be reset')
end
end
end
@@ -167,31 +167,31 @@
end
end
before { persisted_invoice }
- context 'by setting value to nil' do
+ context 'when setting value to nil' do
+ subject { updated_persisted_invoice.country }
+
let(:updated_persisted_invoice) do
# TODO: This VCR cassette needs to be re-recorded again
# when the we fix #172.
VCR.use_cassette("#{vcr_dir}/save_old_with_nil_country") do
repository.save(persisted_invoice.update(country: nil))
end
end
- subject { updated_persisted_invoice.country }
-
pending { is_expected.to eq(nil) }
end
- context 'by setting value to empty string' do
+ context 'when setting value to empty string' do
+ subject { updated_persisted_invoice.country }
+
let(:updated_persisted_invoice) do
VCR.use_cassette("#{vcr_dir}/save_old_with_empty_country") do
repository.save(persisted_invoice.update(country: ''))
end
end
-
- subject { updated_persisted_invoice.country }
it 'does not reset the country' do
is_expected.to eq('SE')
end
end