Skip to content

Commit

Permalink
Fixed failing book view test
Browse files Browse the repository at this point in the history
Also ensured setting system localcache is cleared correctly
  • Loading branch information
ssddanbrown committed Dec 30, 2017
1 parent 359b1b4 commit 96b8c40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/Services/SettingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ protected function clearFromCache($key)
{
$cacheKey = $this->cachePrefix . $key;
$this->cache->forget($cacheKey);
if (isset($this->localCache[$key])) {

This comment has been minimized.

Copy link
@Abijeet

Abijeet Dec 30, 2017

Member

Ah so this is what was causing the test case to fail.

unset($this->localCache[$key]);
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/Entity/EntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ public function test_toggle_book_view()
$this->actingAs($editor)
->visit('/books')
->pageHasElement('.featured-image-container')
->submitForm('Toggle Book View')
->submitForm('List View')
// Check redirection.
->seePageIs('/books')
->pageNotHasElement('.featured-image-container');

$this->actingAs($editor)
->visit('/books')
->submitForm('Toggle Book View')
->submitForm('Grid View')
->seePageIs('/books')
->pageHasElement('.featured-image-container');

Expand Down

0 comments on commit 96b8c40

Please sign in to comment.