Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CTCoreMessage.htmlBody now behaves like .body

It calls fetchBodyStructure if myFields or myParsedMIME is null, just like .body does. Two new tests added; the change to htmlBody is required to get them both to pass.
  • Loading branch information...
commit 1934f9cd518d66eab9163d5eab3dfb08d592873c 1 parent fc5c8a3
@scottnonnenberg scottnonnenberg authored
Showing with 13 additions and 0 deletions.
  1. +3 −0  Source/CTCoreMessage.m
  2. +10 −0 Tests/CTCoreMessageTests.m
View
3  Source/CTCoreMessage.m
@@ -177,6 +177,9 @@ - (BOOL)hasHtmlBody {
}
- (NSString *)htmlBody {
+ if (myFields == NULL || myParsedMIME == nil) {
+ [self fetchBodyStructure];
+ }
NSMutableString *result = [NSMutableString string];
[self _buildUpHtmlBodyText:myParsedMIME result:result];
return result;
View
10 Tests/CTCoreMessageTests.m
@@ -47,6 +47,16 @@ - (void)tearDown {
[myRealMsg release];
}
+- (void)testBody {
+ STAssertTrue([[myRealMsg body] rangeOfString:@"Kiwi-dev mailing list"].location != NSNotFound, @"Expect to pull out the right text");
+ NSLog(@"Body is %@", [myRealMsg body]);
+}
+
+- (void)testHtmlBody {
+ STAssertTrue([[myRealMsg htmlBody] rangeOfString:@"CTCoreMessage no longer depends"].location != NSNotFound, @"Expect to pull out the right text");
+ NSLog(@"Html body is %@", [myRealMsg htmlBody]);
+}
+
- (void)testBasicSubject {
[myMsg setSubject:@"Test value1!"];
STAssertEqualObjects(@"Test value1!", [myMsg subject], @"Basic set and get of subject failed.");
Please sign in to comment.
Something went wrong with that request. Please try again.