OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/models/planning_element_scenario_s...

62 lines
1.9 KiB

#-- copyright
# OpenProject is a project management system.
#
# Copyright (C) 2012-2013 the OpenProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
require File.expand_path('../../spec_helper', __FILE__)
describe PlanningElementScenario do
let(:project) { FactoryGirl.build(:project) }
let(:planning_element) { FactoryGirl.build(:planning_element, :project => project) }
let(:scenario) { FactoryGirl.build(:scenario, :project => project) }
let(:alternate_date) { FactoryGirl.build(:alternate_date, :scenario => scenario,
:planning_element => planning_element) }
let(:subject) { PlanningElementScenario.new(alternate_date) }
it 'delegates start_date to the alternate date' do
subject.start_date.should == alternate_date.start_date
end
it 'delegates start_date= to the alternate date' do
d = Date.new(1982, 01, 31)
subject.start_date = d
alternate_date.start_date.should == d
end
it 'delegates end_date to the alternate date' do
subject.end_date.should == alternate_date.end_date
end
it 'delegates end_date= to the alternate date' do
d = Date.new(1982, 01, 31)
subject.end_date = d
alternate_date.end_date.should == d
end
it 'delegates duration to the alternate date' do
subject.duration.should eql alternate_date.duration
end
it 'delegates scenario to the alternate date' do
subject.scenario.should == alternate_date.scenario
end
it 'delegates scenario_id to the alternate date' do
subject.scenario_id.should == alternate_date.scenario_id
end
it 'delegates name to the scenario' do
subject.name.should == scenario.name
end
it 'delegates id to the scenario' do
subject.id.should == scenario.id
end
end