Created
May 21, 2013 08:45
-
-
Save Lackoftactics/5618394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? | |
end | |
should "be valid with open_at" do | |
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, start_at: nil, end_at: Time.now + 1.hour) | |
assert event.valid? | |
end | |
should "be valid with start_at " do | |
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, open_at: nil, end_at: Time.now + 1.hour) | |
assert event.valid? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment