Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix GoodsNomenclature factory and related specs

  • Loading branch information...
commit 5b058bcf9fcb9470de26aac34f9a4edda84b5d04 1 parent c4c6497
@saulius saulius authored
View
2  spec/factories/goods_nomenclature_factory.rb
@@ -126,8 +126,6 @@
ignore do
validity_start_date { Date.today.ago(3.years) }
validity_end_date { nil }
- valid_at Time.now.ago(2.years)
- valid_to nil
end
goods_nomenclature_sid { generate(:sid) }
View
24 spec/models/goods_nomenclature_spec.rb
@@ -73,12 +73,12 @@
let!(:goods_nomenclature) { create :goods_nomenclature }
let!(:goods_nomenclature_description1) { create :goods_nomenclature_description,
goods_nomenclature_sid: goods_nomenclature.goods_nomenclature_sid,
- valid_at: 2.years.ago,
- valid_to: nil }
+ validity_start_date: 2.years.ago,
+ validity_end_date: nil }
let!(:goods_nomenclature_description2) { create :goods_nomenclature_description,
goods_nomenclature_sid: goods_nomenclature.goods_nomenclature_sid,
- valid_at: 5.years.ago,
- valid_to: 3.years.ago }
+ validity_start_date: 5.years.ago,
+ validity_end_date: 3.years.ago }
context 'direct loading' do
it 'loads correct description respecting given actual time' do
@@ -133,12 +133,12 @@
let!(:goods_nomenclature) { create :goods_nomenclature }
let!(:goods_nomenclature_description1) { create :goods_nomenclature_description,
goods_nomenclature_sid: goods_nomenclature.goods_nomenclature_sid,
- valid_at: 3.years.ago,
- valid_to: nil }
+ validity_start_date: 3.years.ago,
+ validity_end_date: nil }
let!(:goods_nomenclature_description2) { create :goods_nomenclature_description,
goods_nomenclature_sid: goods_nomenclature.goods_nomenclature_sid,
- valid_at: 5.years.ago,
- valid_to: nil }
+ validity_start_date: 5.years.ago,
+ validity_end_date: nil }
context 'direct loading' do
it 'loads correct description respecting given actual time' do
@@ -195,12 +195,12 @@
validity_end_date: nil }
let!(:goods_nomenclature_description1) { create :goods_nomenclature_description,
goods_nomenclature_sid: goods_nomenclature.goods_nomenclature_sid,
- valid_at: 2.years.ago,
- valid_to: nil }
+ validity_start_date: 2.years.ago,
+ validity_end_date: nil }
let!(:goods_nomenclature_description2) { create :goods_nomenclature_description,
goods_nomenclature_sid: goods_nomenclature.goods_nomenclature_sid,
- valid_at: 5.years.ago,
- valid_to: 3.years.ago }
+ validity_start_date: 5.years.ago,
+ validity_end_date: 3.years.ago }
it 'fetches correct description' do
TimeMachine.with_relevant_validity_periods {
goods_nomenclature.goods_nomenclature_description.pk.should eq goods_nomenclature_description1.pk
Please sign in to comment.
Something went wrong with that request. Please try again.