Permalink
Browse files

TodoAppTest (新增 1 筆 task 立即刪除)

  • Loading branch information...
1 parent 3a91cbd commit e2231b0dfafd14fdc7b030ab91513dd68f08f7b7 Sam.IO.Hsiao committed Oct 18, 2016
Showing with 24 additions and 0 deletions.
  1. +24 −0 tests/TodoAppTest.php
View
@@ -54,4 +54,28 @@ public function 新增1筆task並顯示在下方()
'name' => 'Task 1'
]);
}
+
+ /** @test */
+ public function 新增1task立即刪除()
+ {
+ $this->visit($this->rootURL)
+ ->dontSee('Task 1')
+ ->dontSeeInDatabase('tasks', [
+ 'name' => 'Task 1'
+ ]);
+
+ $this->visit($this->rootURL)
+ ->type('Task 1', 'name')
+ ->press('Add Task')
+ ->see('Task 1')
+ ->seeInDatabase('tasks', [
+ 'name' => 'Task 1'
+ ]);
+
+ $this->post($this->rootURL . '/task/1')
+ ->dontSee('Task 1')
+ ->dontSeeInDatabase('tasks', [
+ 'name' => 'Task 1'
+ ]);
+ }
}

0 comments on commit e2231b0

Please sign in to comment.