public function testUnfollowActivity(\FunctionalTester $I) { $I->wantTo('check that Unfollow button works'); self::testFollowActivity($I); $I->sendAjaxPostRequest(IndexPage::getUnfollowLink(\Project::$id)); IndexPage::openBy($I); $I->dontSeeRecord('app\\models\\ProjectActivityFollowers', ['activityID' => \ProjectActivity::$id, 'usersFollowing' => \Yii::$app->getUser()->getId()]); $I->seeLink(IndexPage::$followButtonText, IndexPage::getFollowLink(\Project::$id)); $I->dontSeeLink(IndexPage::$unfollowButtonText, IndexPage::getUnfollowLink(\Project::$id)); }