Skip to content

Commit

Permalink
Merge pull request #114 from sroebert/bug/pivot
Browse files Browse the repository at this point in the history
Added test for pivot database setting
  • Loading branch information
tanner0101 committed Oct 17, 2016
2 parents edec439 + aea98ff commit 5c30919
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/FluentTests/RelationTests.swift
Expand Up @@ -5,6 +5,8 @@ class RelationTests: XCTestCase {
static let allTests = [
("testHasMany", testHasMany),
("testBelongsToMany", testBelongsToMany),
("testCustomForeignKey", testCustomForeignKey),
("testPivotDatabase", testPivotDatabase),
]

var memory: MemoryDriver!
Expand Down Expand Up @@ -69,4 +71,10 @@ class RelationTests: XCTestCase {
print(error)
}
}

func testPivotDatabase() throws {
Pivot<Atom, Nucleus>.database = database
XCTAssertTrue(Pivot<Atom, Nucleus>.database === database)
XCTAssertTrue(Pivot<Nucleus, Atom>.database === database)
}
}

0 comments on commit 5c30919

Please sign in to comment.