Skip to content

Commit

Permalink
= :medium added to image.path (publiclab#10100)
Browse files Browse the repository at this point in the history
* = :medium added to image.path

to fix publiclab#10099

* Update image_test.rb
  • Loading branch information
jywarren authored and reginaalyssa committed Oct 16, 2021
1 parent 51ebb61 commit 72bb5e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def filetype
end
end

def path(size)
def path(size = :medium)
if is_image? && size == :default
size = :medium
end
Expand Down
2 changes: 2 additions & 0 deletions test/unit/image_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class ImageTest < ActiveSupport::TestCase
test 'should not contains special characters in value' do
image = images(:one)
assert image.is_image?
assert_not_nil image.path
assert_not_nil image.path(:original)
assert_equal "jpg", image.filetype
assert_equal "/i/#{image.id}", image.shortlink
assert_not_nil image.filename
Expand Down

0 comments on commit 72bb5e0

Please sign in to comment.