Skip to content

Commit

Permalink
Test: update steps
Browse files Browse the repository at this point in the history
  • Loading branch information
satrun77 committed Aug 20, 2015
1 parent dd9452b commit 2b8da4b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/functional/CrudAttachmentCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public function addIssueComment(FunctionalTester $I)
'comment' => $comment,
]);
$I->seeResponseCodeIs(200);
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->amOnAction('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$I->see($comment, '.comment .content');
$I->seeLink($fileName1);
$I->seeLink($fileName2);
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/CrudIssueCommentCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function addComment(FunctionalTester $I)
$I->fillField('comment', 'Comment one');
$I->click(trans('tinyissue.comment'));
$I->seeResponseCodeIs(200);
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue]);
$comment = $issue->comments->last();
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project, 'issue' => $issue->id . '#comment' . $comment->id]);
$I->see('Comment one', '.comment .content');
}

Expand Down
3 changes: 2 additions & 1 deletion tests/functional/PermissionDeveloperCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public function addCommentToIssue(FunctionalTester\UserSteps $I)
$I->fillField('comment', 'Comment one');
$I->click(trans('tinyissue.comment'));
$I->seeResponseCodeIs(200);
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2]);
$comment = $issue2->comments->last();
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2->id . '#comment' . $comment->id]);
$I->see('Comment one', '.comment .content');
$I->amOnAction('Project\IssueController@getIndex', ['project' => $project1, 'issue' => $issue1]);
$I->dontSee(trans('tinyissue.comment_on_this_issue'));
Expand Down
3 changes: 2 additions & 1 deletion tests/functional/PermissionManagerCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public function addCommentToIssue(FunctionalTester\UserSteps $I)
$I->fillField('comment', 'Comment one');
$I->click(trans('tinyissue.comment'));
$I->seeResponseCodeIs(200);
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2]);
$comment = $issue2->comments->last();
$I->seeCurrentActionIs('Project\IssueController@getIndex', ['project' => $project2, 'issue' => $issue2->id . '#comment' . $comment->id]);
$I->see('Comment one', '.comment .content');
$I->amOnAction('Project\IssueController@getIndex', ['project' => $project1, 'issue' => $issue1]);
$I->see(trans('tinyissue.comment_on_this_issue'));
Expand Down
14 changes: 7 additions & 7 deletions tests/functional/UserCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public function updateFirstLastName(FunctionalTester $I)
$I->amLoggedAs($user);
$I->amOnAction('UserController@getSettings');
$I->fillField('firstname', 'First');
$I->fillField('lastname', 'Last');
$I->click('Update');
// $I->fillField('lastname', 'Last');
$I->click(trans('tinyissue.update'));
$I->seeInField('firstname', 'First');
$I->seeInField('lastname', 'Last');
// $I->seeInField('lastname', 'Last');
$I->seeLink('First', '/user/settings');
}

Expand All @@ -43,10 +43,10 @@ public function updateEmail(FunctionalTester $I)
$I->amLoggedAs($user);
$I->amOnAction('UserController@getSettings');
$I->fillField('email', 'email');
$I->click('Update');
$I->click(trans('tinyissue.update'));
$I->seeFormHasErrors();
$I->fillField('email', '[email protected]');
$I->click('Update');
$I->click(trans('tinyissue.update'));
$I->seeInField('email', '[email protected]');
}

Expand All @@ -68,11 +68,11 @@ public function passwordNotMatched(FunctionalTester\UserSteps $I)
$I->amOnAction('UserController@getSettings');
$I->fillField('password', '123');
$I->fillField('password_confirmation', '1234');
$I->click('Update');
$I->click(trans('tinyissue.update'));
$I->seeFormHasErrors();
$I->fillField('password', 'newpass');
$I->fillField('password_confirmation', 'newpass');
$I->click('Update');
$I->click(trans('tinyissue.update'));
$I->logout();
$I->login($user->email, 'newpass', $user->firstname);
}
Expand Down

0 comments on commit 2b8da4b

Please sign in to comment.