This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix GoodsNomenclature factory and related specs

  • Loading branch information...
1 parent c4c6497 commit 5b058bcf9fcb9470de26aac34f9a4edda84b5d04 @saulius saulius committed Jan 17, 2014
Showing with 12 additions and 14 deletions.
  1. +0 −2 spec/factories/goods_nomenclature_factory.rb
  2. +12 −12 spec/models/goods_nomenclature_spec.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) }
@@ -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

0 comments on commit 5b058bc

Please sign in to comment.