Skip to content

Commit c5d15ae

Browse files
committed
Fixed image_tag attributes issue
1 parent 2e05835 commit c5d15ae

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

app/helpers/filestack_rails/application_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def filestack_image(url, options = {})
3535
transform_object.add_external_url url
3636
image_tag transform_object.fs_url, options
3737
else
38-
image_tag url
38+
image_tag url, options
3939
end
4040
end
4141

filestack-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
1717
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
1818

1919
s.add_dependency 'rails', '>= 4.0'
20-
s.add_dependency "filestack", '~> 2.6.0'
20+
s.add_dependency "filestack", '~> 2.6.5'
2121

2222
s.add_development_dependency 'coveralls'
2323
s.add_development_dependency 'sqlite3', '~> 1.3', '>= 1.3.6'

spec/helpers/application_helper_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@
3939
end
4040

4141
describe "#filestack_image" do
42-
it "returns the correct tag" do
42+
it "returns the image tag with transformation" do
4343
image = filestack_image 'www.example.com', transform: filestack_transform.resize(width: 100, height: 100)
4444
correct = '<img src="https://cdn.filestackcontent.com/API_KEY/resize=width:100,height:100/www.example.com" />'
4545
expect(image).to eq(correct)
4646
end
47+
48+
it "returns the image tag with attributes" do
49+
image = filestack_image 'https://cdn.filestackcontent.com/7Djkxw9TPyEWdjxILnUQ', size: '16x10'
50+
correct = '<img src="https://cdn.filestackcontent.com/7Djkxw9TPyEWdjxILnUQ" width="16" height="10"/>'
51+
expect(image).to eq(correct)
52+
end
4753
end
4854

4955
describe "#get_policy_and_signature" do

0 commit comments

Comments
 (0)