Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszUrbanowicz committed Dec 2, 2015
1 parent 8436e2b commit dd88cff
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions tests/functional/ContentCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function canUseArticleBreadcrumbs(FunctionalTester $I)
'translations' => [
'title' => 'lorem ipsum',
'langCode' => 'en',
'isActive' => 1
'isActive' => 1
]
],
$user
Expand Down Expand Up @@ -128,7 +128,7 @@ public function seeStickyContentOnTopOfTheList(FunctionalTester $I)
'translations' => [
'langCode' => 'en',
'title' => 'This content is sticky.',
'isActive' => 1
'isActive' => 1
]
]
);
Expand All @@ -141,7 +141,7 @@ public function seeStickyContentOnTopOfTheList(FunctionalTester $I)
'translations' => [
'langCode' => 'en',
'title' => 'And this is not.',
'isActive' => 1
'isActive' => 1
]
]
);
Expand All @@ -167,7 +167,7 @@ public function seePromotedContentOnTopOfTheList(FunctionalTester $I)
'translations' => [
'langCode' => 'en',
'title' => 'This content is promoted.',
'isActive' => 1
'isActive' => 1
]
]
);
Expand All @@ -180,7 +180,7 @@ public function seePromotedContentOnTopOfTheList(FunctionalTester $I)
'translations' => [
'langCode' => 'en',
'title' => 'And this is not',
'isActive' => 1
'isActive' => 1
]
]
);
Expand Down Expand Up @@ -238,23 +238,6 @@ public function canSeeNotPublishedCategoryAsAdmin(FunctionalTester $I)
$I->see('This content is not published.');
}


public function canSeeArticleInNotPublishedCategoryAsAdmin(FunctionalTester $I)
{
$category = $I->haveContent(['type' => 'category', 'isActive' => 1]);
$content = $I->haveContent(['type' => 'content', 'isActive' => 1, 'parentId' => $category->id]);
$contentRoute = '/' . $content->route->translations[0]['langCode'] . '/' . $content->route->translations[0]['url'];

$I->wantTo('see article in not published category as admin');
$I->loginAsAdmin();
$I->amOnPage($contentRoute);
$I->seeResponseCodeIs(200);

$I->see($content->translations[0]->title);
$I->see('This content is not published.');
}


public function cantSeeNotPublishedCategoryAsUser(FunctionalTester $I)
{
$category = $I->haveContent(['type' => 'category', 'isActive' => 0]);
Expand All @@ -265,18 +248,6 @@ public function cantSeeNotPublishedCategoryAsUser(FunctionalTester $I)
$I->seeResponseCodeIs(404);
}


public function cantSeeArticleInNotPublishedCategoryAsRegularUser(FunctionalTester $I)
{
$category = $I->haveContent(['type' => 'category', 'isActive' => 0]);
$content = $I->haveContent(['type' => 'content', 'isActive' => 1, 'parentId' => $category->id]);
$contentRoute = '/' . $content->route->translations[0]['langCode'] . '/' . $content->route->translations[0]['url'];

$I->wantTo('cant see article in not published category as regular user');
$I->amOnPage($contentRoute);
$I->seeResponseCodeIs(404);
}

public function canUsePagination(FunctionalTester $I)
{
$category = $I->haveContent(['type' => 'category', 'isActive' => 1]);
Expand All @@ -298,7 +269,7 @@ public function canUsePagination(FunctionalTester $I)
$I->seeResponseCodeIs(200);

$I->click('2');
$I->canSeeCurrentUrlEquals($route.'?page=2');
$I->canSeeCurrentUrlEquals($route . '?page=2');
}

}

0 comments on commit dd88cff

Please sign in to comment.