Last active
March 13, 2020 16:32
-
-
Save andrespch/19e52150214c4b435e7f2a7ea68cf5d1 to your computer and use it in GitHub Desktop.
This file contains 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
#import <Specta/Specta.h> | |
#import "User.h" | |
SpecBegin(User) | |
__block User *subject; | |
before(^{ | |
subject = [[User alloc] init]; | |
}); | |
after(^{ | |
subject = nil; | |
}); | |
describe(@"-canSubscribeToNewsletter", ^{ | |
context(@"email confirmed", ^{ | |
before(^{ | |
subject.hasConfirmedEmail = NO; | |
}); | |
it(@"is true", ^{ | |
NSAssertTrue([subject canSubscribeToNewsletter]); | |
}); | |
}); | |
context(@"email not confirmed", ^{ | |
before(^{ | |
subject.hasConfirmedEmail = YES; | |
}); | |
it(@"is false", ^{ | |
NSAssertFalse([subject canSubscribeToNewsletter]); | |
}); | |
}); | |
}); | |
SpecEnd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment