Even more specs!

pull/6827/head
Felix Schäfer 14 years ago
parent 6b0d64ab2a
commit 2312516bbe
  1. 2
      spec/factories/meeting_participant_factory.rb
  2. 22
      spec/models/meeting_spec.rb

@ -0,0 +1,2 @@
Factory.define :meeting_participant do |mp|
end

@ -4,10 +4,24 @@ describe Meeting do
it {should belong_to :project}
it {should validate_presence_of :title}
describe :to_s do
before(:each) do
@m = Factory.build :meeting, :title => "dingens"
end
before(:all) do
@m = Factory.build :meeting, :title => "dingens"
end
describe "to_s" do
it {@m.to_s.should == "dingens"}
end
describe "start_date" do
it {@m.start_date.should == Date.tomorrow}
end
describe "participants" do
before(:all) do
@m.participants = [Factory.build(:meeting_participant, :user_id => 1002),
Factory.build(:meeting_participant, :user_id => 1003),
Factory.build(:meeting_participant, :user_id => 1020),
Factory.build(:meeting_participant, :user_id => 12)]
end
describe "participant_user_ids" do
it {@m.participant_user_ids.should == [1002, 1003, 1020, 12]}
end
end
end
Loading…
Cancel
Save