Permalink
Browse files

Add better spec test

  • Loading branch information...
darrendao committed Aug 22, 2012
1 parent d384d56 commit 9b2e3ccd4d41a8c9849c260ea6da182770a7685d
Showing with 6 additions and 2 deletions.
  1. +6 −2 spec/models/call_list_spec.rb
@@ -55,13 +55,17 @@
)
@call_list.last_oncall(DateTime.now).should eq(@user2)
+ oncall_assignment = OncallAssignment.make!(:user_id => @user3.id,
+ :call_list_id => @call_list.id,
+ :starts_at => DateTime.now - 7,
+ :ends_at => DateTime.now + 3)
+
oncall_assignment = OncallAssignment.make!(:user_id => @user1.id,
:call_list_id => @call_list.id,
:starts_at => DateTime.now - 7,
:ends_at => DateTime.now + 2
)
- @call_list.last_oncall(DateTime.now).should eq(@user1)
- @call_list.last_oncall(DateTime.now).should eq(@user1)
+ @call_list.last_oncall(DateTime.now).should eq(@user3)
end
it "returns last oncall correctly when passing in datetime in future" do

0 comments on commit 9b2e3cc

Please sign in to comment.