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/meeting_spec.rb

54 lines
1.4 KiB

14 years ago
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Meeting do
it {should belong_to :project}
14 years ago
it {should belong_to :author}
14 years ago
it {should validate_presence_of :title}
14 years ago
it {should validate_presence_of :start_time}
it {pending; should accept_nested_attributes_for :participants} # geht das?
14 years ago
before(:all) do
@m = Factory.build :meeting, :title => "dingens"
end
14 years ago
describe "to_s" do
14 years ago
it {@m.to_s.should == "dingens"}
end
14 years ago
describe "start_date" do
it {@m.start_date.should == Date.tomorrow}
end
14 years ago
describe "start_month" do
it {@m.start_month.should == Date.tomorrow.month}
end
14 years ago
describe "start_year" do
it {@m.start_year.should == Date.tomorrow.year}
end
14 years ago
describe "end_time" do
it {@m.end_time.should == Date.tomorrow + 11.hours}
end
14 years ago
describe "time-sorted finder" do
it {pending}
end
describe "Journalized Objects" do
before(:each) do
@project ||= Factory.create(:project_with_trackers)
@current = Factory.create(:user, :login => "user1", :mail => "user1@users.com")
User.stub!(:current).and_return(@current)
end
it 'should work with meeting' do
@meeting ||= Factory.create(:meeting, :title => "Test", :project => @project, :author => @current)
initial_journal = @meeting.journals.first
recreated_journal = @meeting.recreate_initial_journal!
initial_journal.identical?(recreated_journal).should be true
end
end
end