Skip to content

Instantly share code, notes, and snippets.

View Lackoftactics's full-sized avatar

Przemyslaw Mroczek Lackoftactics

  • Warsaw, Poland
  • 15:08 (UTC +02:00)
View GitHub Profile
{"first_name":"Tomek","last_name":"K","avatar_url":null,"short_address":"Brandenburg, Germany","user_url":"/users/user5-el","pending_friendships":[{"agripoints":0,"avatar_content_type":null,"avatar_file_name":null,"avatar_file_size":null,"avatar_updated_at":null,"confirmation_reminder":false,"created_at":"2013-06-11T14:17:51Z","deals_newsletter":false,"email":"user5@agricircle.com","first_name":"User5","id":20,"language":"English","last_name":"El","newsletter":false,"slug":"user5-el","terms_of_service":true,"title":"Mr","updated_at":"2013-06-11T14:17:51Z","user_type":"Farmer","website":"http:\\codequest.com"}]}
context "Validates presence of either start time or open time" do
setup do
@user = FactoryGirl.create(:user)
@account = FactoryGirl.create(:account, user: @user)
@location = FactoryGirl.create(:location, account: @account)
end
should "not be valid without open time or start time " do
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, start_at: nil, open_at: nil, end_at: Time.now + 1.hour)
assert !event.valid?
context "Validates presence of either start time or open time" do
setup do
@user = FactoryGirl.create(:user)
@account = FactoryGirl.create(:account, user: @user)
@location = FactoryGirl.create(:location, account: @account)
end
should "not be valid without open time or start time " do
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, start_at: nil, open_at: nil, end_at: Time.now + 1.hour)
assert !event.valid?