-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from ijpatricio/feat/bust-cache-custom-assets
Feat/bust cache custom assets
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace BinaryTorch\LaRecipe\Tests\Feature; | ||
|
||
use Illuminate\Support\Facades\Config; | ||
use BinaryTorch\LaRecipe\Tests\TestCase; | ||
|
||
class BustCustomAssetsCacheTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function custom_css_and_js_display_random_string_on_query_param() | ||
{ | ||
// set the docs path and landing | ||
Config::set('larecipe.docs.path', 'tests/views/docs'); | ||
Config::set('larecipe.docs.landing', 'foo'); | ||
|
||
// set auth to false | ||
Config::set('larecipe.settings.auth', false); | ||
|
||
$customCssFile = 'veryUniqueCssCustomFile.css'; | ||
$customJsFile = 'veryUniqueJsCustomFile.js'; | ||
|
||
Config::set('larecipe.ui.additional_css', [ "/js/{$customCssFile}" ]); | ||
Config::set('larecipe.ui.additional_js', [ "/js/{$customJsFile}" ]); | ||
|
||
// guest can view foo page | ||
$this->get('/docs/1.0') | ||
->assertStatus(200) | ||
->assertSee("/js/{$customCssFile}?id=") | ||
->assertSee("/js/{$customJsFile}?id="); | ||
|
||
} | ||
|
||
|
||
|
||
} |