reloads alternate_dates in specs where necessary

pull/291/head
Jens Ulferts 11 years ago
parent 12de6e45b9
commit 6431fee0aa
  1. 6
      spec/models/planning_element_spec.rb

@ -642,7 +642,7 @@ describe PlanningElement do
let(:journal_scenario) { FactoryGirl.create(:scenario) }
# PlanningElements create a alternate_date on save by default, so just use that
it "should create a journal entry if a scenario gets assigned to an alternate date" do
alternate_date = journal_planning_element.alternate_dates.first.tap do |ad|
alternate_date = journal_planning_element.alternate_dates(true).first.tap do |ad|
ad.scenario = journal_scenario
end
journal_planning_element.save!
@ -662,7 +662,7 @@ describe PlanningElement do
it "should create a journal entry if a scenario gets removed from an alternate date" do
# PlanningElements create a alternate_date on save by default, so just use that
alternate_date = journal_planning_element.alternate_dates.first.tap do |ad|
alternate_date = journal_planning_element.alternate_dates(true).first.tap do |ad|
ad.scenario = journal_scenario
end
journal_planning_element.save!
@ -683,7 +683,7 @@ describe PlanningElement do
it "should create seperate journal entries for start_date and due_date if only one of 'em is modified" do
# PlanningElements create an alternate_date on save by default, so just use that
alternate_date = journal_planning_element.alternate_dates.first.tap do |ad|
alternate_date = journal_planning_element.alternate_dates(true).first.tap do |ad|
ad.start_date = Date.today
ad.due_date = Date.today + 1.month
ad.scenario = journal_scenario

Loading…
Cancel
Save