kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
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.
63 lines
1.9 KiB
63 lines
1.9 KiB
12 years ago
|
#-- 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.
|
||
|
#++
|
||
|
|
||
12 years ago
|
require File.expand_path('../../../spec_helper', __FILE__)
|
||
|
|
||
12 years ago
|
describe PlanningElementScenario do
|
||
12 years ago
|
let(:project) { FactoryGirl.build(:project) }
|
||
12 years ago
|
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,
|
||
12 years ago
|
:planning_element => planning_element) }
|
||
|
|
||
12 years ago
|
let(:subject) { PlanningElementScenario.new(alternate_date) }
|
||
12 years ago
|
|
||
|
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
|