diff options
author | pilsner <pilsner@teamlegoui-Mac-Pro.local> | 2015-09-03 12:55:43 +0300 |
---|---|---|
committer | pilsner <pilsner@teamlegoui-Mac-Pro.local> | 2015-09-04 07:06:02 +0300 |
commit | 4144c59941e8e91bbaff2c68e757af0f01f7997d (patch) | |
tree | cb28256c8584c13cafd07dfe56e248ec2c6997be /spec | |
parent | 996f51559b428102b4c9540617ee9f0847246d74 (diff) |
add Content-Type header of raw image file
Add Content-Type header to fix a bug which IE can't show image in
markdown when the image is from raw.
modified: CHANGELOG
modified: app/controllers/projects/raw_controller.rb
modified: spec/controllers/projects/raw_controller_spec.rb
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/projects/raw_controller_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/projects/raw_controller_spec.rb b/spec/controllers/projects/raw_controller_spec.rb index 1f921d5f05d..c114f342021 100644 --- a/spec/controllers/projects/raw_controller_spec.rb +++ b/spec/controllers/projects/raw_controller_spec.rb @@ -19,5 +19,19 @@ describe Projects::RawController do to eq("inline") end end + + context 'image header' do + let(:id) { 'master/files/images/6049019_460s.jpg' } + + it 'set image content type header' do + get(:show, + namespace_id: public_project.namespace.to_param, + project_id: public_project.to_param, + id: id) + + expect(response.status).to eq(200) + expect(response.header['Content-Type']).to eq('image/jpeg') + end + end end end |