Skip to content

Commit

Permalink
Move test to Quick/Nimble (MessageKit#924)
Browse files Browse the repository at this point in the history
Moved **testMessageCollectionView_hasMessageCollectionFlowLayoutAfterViewDidLoad** to MessagesViewControlerSpec.swift and removed a duplication of this test
  • Loading branch information
Aleph Retamal authored and SD10 committed Nov 2, 2018
1 parent 801b1e2 commit 6f04569
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Tests/ControllersTest/MessagesViewControllerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ final class MessagesViewControllerSpec: QuickSpec {
it("has a MessagesCollectionView") {
expect(controller.messagesCollectionView).toNot(beNil())
}
it("sets the CollectionView's layout to be an instance of MessagesCollectionViewFlowLayout") {
expect(controller.messagesCollectionView.collectionViewLayout).to(beAnInstanceOf(MessagesCollectionViewFlowLayout.self))
}
}
context("after viewDidLoad") {
beforeEach {
Expand Down
12 changes: 0 additions & 12 deletions Tests/ControllersTest/MessagesViewControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ class MessagesViewControllerTests: XCTestCase {

// MARK: - Test

func testMessageCollectionViewLayout_isMessageCollectionViewLayout() {
XCTAssertNotNil(sut.messagesCollectionView.collectionViewLayout)
XCTAssertTrue(sut.messagesCollectionView.collectionViewLayout is MessagesCollectionViewFlowLayout)
}

func testMessageCollectionView_hasMessageCollectionFlowLayoutAfterViewDidLoad() {
let layout = sut.messagesCollectionView.collectionViewLayout

XCTAssertNotNil(layout)
XCTAssertTrue(layout is MessagesCollectionViewFlowLayout)
}

func testViewDidLoad_shouldSetDelegateAndDataSourceToTheSameObject() {
XCTAssertEqual(sut.messagesCollectionView.delegate as? MessagesViewController,
sut.messagesCollectionView.dataSource as? MessagesViewController)
Expand Down

0 comments on commit 6f04569

Please sign in to comment.