From ed46dee64600b3bd1c6b9e192a15fedea55a1f6e Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 23 May 2017 03:03:30 -0700 Subject: [PATCH] Dept tests --- tests/acceptance/DepartmentsCept.php | 24 ++++++++++++++++++++++++ tests/unit/DepartmentTest.php | 27 +++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 tests/acceptance/DepartmentsCept.php create mode 100644 tests/unit/DepartmentTest.php diff --git a/tests/acceptance/DepartmentsCept.php b/tests/acceptance/DepartmentsCept.php new file mode 100644 index 000000000000..6549eac7ce13 --- /dev/null +++ b/tests/acceptance/DepartmentsCept.php @@ -0,0 +1,24 @@ +am('logged in user'); +$I->wantTo('ensure that the department listing page loads without errors'); +$I->lookForwardTo('seeing it load without errors'); +$I->amOnPage('/departments'); +$I->waitForElement('.table', 5); // secs +$I->seeNumberOfElements('table[name="departments"] tr', [5,30]); +$I->seeInTitle('Departments'); +$I->see('Departments'); +$I->seeInPageSource('departments/create'); +$I->dontSee('Departments', '.page-header'); +$I->see('Departments', 'h1.pull-left'); + +/* Create Form */ +$I->wantTo('ensure that the create department form loads without errors'); +$I->lookForwardTo('seeing it load without errors'); +$I->click(['link' => 'Create New']); +$I->amOnPage('/department/create'); +$I->dontSee('Create Department', '.page-header'); +$I->see('Create Department', 'h1.pull-left'); +$I->dontSee('<span class="'); diff --git a/tests/unit/DepartmentTest.php b/tests/unit/DepartmentTest.php new file mode 100644 index 000000000000..a97fdc4808c6 --- /dev/null +++ b/tests/unit/DepartmentTest.php @@ -0,0 +1,27 @@ +make(); + $values = [ + 'name' => $department->name, + ]; + + Department::create($values); + $this->tester->seeRecord('departments', $values); + } + +}