Skip to content

Commit b1aacda

Browse files
committed
Remove duplicate version in cache
1 parent 2d43ada commit b1aacda

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/sprockets/railtie.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def self.build_environment(app)
9292
# the Sprockets cache when changed.
9393
env.version = [
9494
::Rails.env,
95-
::Rails.env, # TODO: Remove duplicate key
9695
config.assets.version,
9796
config.action_controller.relative_url_root,
9897
(config.action_controller.asset_host unless config.action_controller.asset_host.respond_to?(:call)),

test/test_railtie.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_defaults
5151
assert_kind_of Sprockets::Environment, env
5252

5353
assert_equal ROOT, env.root
54-
assert_equal "test-test--#{Sprockets::Rails::VERSION}", env.version
54+
assert_equal "test--#{Sprockets::Rails::VERSION}", env.version
5555
assert env.cache
5656
assert_equal [], env.paths
5757
assert_nil env.js_compressor
@@ -137,7 +137,7 @@ def test_version
137137
app.initialize!
138138

139139
assert env = app.assets
140-
assert_equal "test-test-v2-#{Sprockets::Rails::VERSION}", env.version
140+
assert_equal "test-v2-#{Sprockets::Rails::VERSION}", env.version
141141
end
142142

143143
def test_version_fragments_with_string_asset_host
@@ -149,7 +149,7 @@ def test_version_fragments_with_string_asset_host
149149
app.initialize!
150150

151151
assert env = app.assets
152-
assert_equal "test-test-v2-some-path-http://some-cdn.com-#{Sprockets::Rails::VERSION}", env.version
152+
assert_equal "test-v2-some-path-http://some-cdn.com-#{Sprockets::Rails::VERSION}", env.version
153153
end
154154

155155
def test_version_fragments_with_proc_asset_host
@@ -163,7 +163,7 @@ def test_version_fragments_with_proc_asset_host
163163
app.initialize!
164164

165165
assert env = app.assets
166-
assert_equal "test-test-v2-some-path-#{Sprockets::Rails::VERSION}", env.version
166+
assert_equal "test-v2-some-path-#{Sprockets::Rails::VERSION}", env.version
167167
end
168168

169169
def test_configure

0 commit comments

Comments
 (0)