public function isEditedPost(AcceptanceTester $I, UserSteps $userSteps) { $I->wantTo('check history for post which is edited'); $userId = $userSteps->amRegularUser(); $catId = $userSteps->haveCategory(); $postId = $I->havePost(['title' => 'Some title', 'content' => 'Some content.', 'users_id' => $userId, 'categories_id' => $catId]); $I->havePostHistory(['posts_id' => $postId, 'users_id' => $userId, 'content' => 'Some content II.']); $I->amOnPage("/discussion/{$postId}/some-title"); $I->see('edited'); }
public function deleteADiscussion(FunctionalTester $I, UserSteps $userSteps) { $userId = $userSteps->amRegularUser(); $catId = $userSteps->haveCategory(); $postId = $userSteps->havePost(['title' => 'Is there a way to validate only some fields?', 'users_id' => $userId, 'categories_id' => $catId]); $I->amOnPage("/discussion/{$postId}/abc"); $I->seeInTitle('Is there a way to validate only some fields? - Discussion'); $I->seeElement(['css' => 'a.btn-delete-post']); $I->click(['css' => 'a.btn-delete-post']); $I->see('Discussion was successfully deleted', '//body/div[1]/div/div/div'); }