-
-
Notifications
You must be signed in to change notification settings - Fork 318
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 #2436 from tvdeyen/fix-non-stupid-assets
Fix non_stupid_digest_assets
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
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,24 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
require "non_stupid_digest_assets" | ||
|
||
RSpec.describe NonStupidDigestAssets do | ||
describe ".assets" do | ||
context "when the whitelist is empty" do | ||
it "returns the assets" do | ||
NonStupidDigestAssets.whitelist = [] | ||
assets = { "foo.js" => "foo-123.js" } | ||
expect(NonStupidDigestAssets.assets(assets)).to eq(assets) | ||
end | ||
end | ||
|
||
context "when the whitelist is not empty" do | ||
it "returns the assets that match the whitelist" do | ||
NonStupidDigestAssets.whitelist = [/foo/] | ||
assets = { "foo.js" => "foo-123.js", "bar.js" => "bar-123.js" } | ||
expect(NonStupidDigestAssets.assets(assets)).to eq("foo.js" => "foo-123.js") | ||
end | ||
end | ||
end | ||
end |