Browse files

Add time calculating to event spec.

  • Loading branch information...
1 parent 2a92953 commit cfa4e4980f006986ddd44a23ef023e1494bc7278 Mike Simpson committed Nov 16, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 spec/models/event_spec.rb
View
18 spec/models/event_spec.rb
@@ -1,7 +1,23 @@
require 'spec_helper'
+before :all do
+
+ vote1 = Vote.new
+ vote2 = Vote.new
+ vote3 = Vote.new
+ timeslot1 = Timeslot.new
+ timeslot2 = Timeslot.new
+ event = Event.new(timeslots: [timeslot1, timeslot2])
+end
describe Event do
-
+ it "calculates the most popular time" do
+ timeslot1.votes = [vote1, vote2]
+ timeslot2.vote = vote3
+ event.calculate_event_time.should_be timeslot2
+
+ end
+
+end
it "should calculate_event_time" do
end

0 comments on commit cfa4e49

Please sign in to comment.