The user should be able to add an item to the list view. As shown in the mockups in Chapter 2, Planning and Structuring Your Test-Driven iOS App, there should be an Add button in the navigation bar that presents the input view controller. We will add the following tests to ItemListViewControllerTests because these are tests about ItemListViewController.
Open ItemListViewControllerTests and add this test:
func test_ItemListViewController_HasAddBarButtonWithSelfAsTarget() { let target = sut.navigationItem.rightBarButtonItem?.target XCTAssertEqual(target as? UIViewController, sut) }
To make this test pass, we need to add a bar button item to the item list view controller. Open Main.storyboard, drag a Bar Button Item