diff options
author | stuconnolly <stuart02@gmail.com> | 2012-07-21 05:39:14 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-07-21 05:39:14 +0000 |
commit | 156a0e45f7ef5d4a3badc09bec0bff66ed3d2400 (patch) | |
tree | 3bec535ffc28eab9d5a897cffb2e255383d2bc5d /Frameworks | |
parent | 3f9fe159d05993fede4338135d48866133ef38b5 (diff) | |
download | sequelpro-156a0e45f7ef5d4a3badc09bec0bff66ed3d2400.tar.gz sequelpro-156a0e45f7ef5d4a3badc09bec0bff66ed3d2400.tar.bz2 sequelpro-156a0e45f7ef5d4a3badc09bec0bff66ed3d2400.zip |
QueryKit: Add test to check the explicit use of a database name in an update query.
Diffstat (limited to 'Frameworks')
-rw-r--r-- | Frameworks/QueryKit/Tests/QKUpdateQueryTests.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m b/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m index afeb9434..892e526f 100644 --- a/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m +++ b/Frameworks/QueryKit/Tests/QKUpdateQueryTests.m @@ -86,6 +86,15 @@ STAssertTrue([[[self query] query] hasPrefix:@"UPDATE"], nil); } +- (void)testUpdateQueryUsingDatabaseAndTableIsCorrect +{ + [[self query] setDatabase:QKTestDatabaseName]; + + NSString *query = [NSString stringWithFormat:@"UPDATE %1$@%2$@%1$@.%1$@%3$@%1$@", [self identifierQuote], QKTestDatabaseName, QKTestTableName]; + + STAssertTrue([[[self query] query] hasPrefix:query], nil); +} + - (void)testUpdateQueryFieldsAreCorrect { NSString *query = [NSString stringWithFormat:@"UPDATE %1$@%2$@%1$@ SET %1$@%3$@%1$@ = '%4$@', %1$@%5$@%1$@ = '%6$@'", [self identifierQuote], QKTestTableName, QKTestFieldOne, QKTestUpdateValueOne, QKTestFieldTwo, QKTestUpdateValueTwo]; |