Browse files

Merge branch 'master' of github.com:SciMed/temptd

Conflicts:
	spec/models/event_spec.rb
  • Loading branch information...
2 parents 003db55 + eea6ba7 commit 03a4105e86a5bbfe35d85a47a1151fb5694c40e5 Derick Hitchcock committed Nov 16, 2012
Showing with 21 additions and 1 deletion.
  1. +19 −0 spec/factories.rb
  2. +2 −1 spec/models/event_spec.rb
View
19 spec/factories.rb
@@ -0,0 +1,19 @@
+require 'factory_girl_rails'
+require 'faker'
+
+FactoryGirl.define do
+
+ factory :event_type do
+ name { Faker::Company.name }
+ end
+
+ factory :event do
+ event_type factory: :event_type
+ end
+
+ factory :timeslot do
+ event factory: :event
+ starts_at { Time.now }
+ ends_at { starts_at + 2.hour }
+ end
+end
View
3 spec/models/event_spec.rb
@@ -11,14 +11,15 @@
event = Event.new(timeslots: [timeslot1, timeslot2])
end
+
it "calculates the most popular time" do
timeslot1.votes = [vote1, vote2]
timeslot2.vote = vote3
event.calculate_event_time.should_be timeslot2
-
end
+
it "should calculate_event_time" do
end

0 comments on commit 03a4105

Please sign in to comment.