Skip to content

Commit

Permalink
Fix AssetHelpersTest
Browse files Browse the repository at this point in the history
Two test cases in this file were affected by the CDO.use_my_apps
configuration of the environment they were running in.  This caused them
to consistently fail on our test environment.  I'm fixing this by
stubbing the use_my_apps method in the tests with this dependency.
  • Loading branch information
islemaster committed Jul 17, 2020
1 parent 95f0f0c commit 99decb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/test/cdo/test_asset_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_missing_manifest

def test_valid_asset_with_unoptimized_webpack_assets
CDO.stubs(:optimize_webpack_assets).returns(false)
CDO.stubs(:use_my_apps).returns(true)
assert_equal(
'/assets/js/cookieBanner.js',
@asset_helper.webpack_asset_path('js/cookieBanner.js')
Expand All @@ -40,6 +41,7 @@ def test_valid_asset_with_unoptimized_webpack_assets

def test_missing_manifest_with_unoptimized_webpack_assets
CDO.stubs(:optimize_webpack_assets).returns(false)
CDO.stubs(:use_my_apps).returns(true)
AssetHelper.any_instance.stubs(:webpack_manifest_path).returns('./test/fixtures/nonexistent.json')
assert_equal(
'/assets/js/cookieBanner.js',
Expand Down

0 comments on commit 99decb4

Please sign in to comment.