Skip to content

Commit

Permalink
Fix image kind names
Browse files Browse the repository at this point in the history
I accidentally broke these refactoring a .map() to a .transform_values()
even though I was using the key. Before this change .name() was the
class name (Whitehall::ImageKinds), not the name of the image kind.
  • Loading branch information
richardTowers committed Nov 6, 2024
1 parent 59f01b5 commit 46f9040
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/whitehall/image_kinds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def version_names

class ImageKinds
def self.build_image_kinds(hash)
hash.transform_values { |config| ImageKind.new(name, config) }.freeze
hash.to_h { |name, config| [name, ImageKind.new(name, config)] }.freeze
end
end
end
1 change: 1 addition & 0 deletions test/unit/lib/whitehall_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class WhitehallTest < ActiveSupport::TestCase
test "Whitehall.image_kinds is populated with defaults from config" do
assert_pattern do
Whitehall.image_kinds["default"] => {
name: "default",
valid_width: 960,
valid_height: 640,
versions: [
Expand Down

0 comments on commit 46f9040

Please sign in to comment.