Commit dd2870128afd53b714e1275ffd25e835c35ef118
Exists in
master
and in
28 other branches
Merge branch 'AI3131' of https://gitlab.com/arthurmde/noosfero into AI3131
Showing
2 changed files
with
16 additions
and
0 deletions
Show diff stats
app/presenters/image.rb
test/functional/content_viewer_controller_test.rb
... | ... | @@ -75,6 +75,18 @@ class ContentViewerControllerTest < ActionController::TestCase |
75 | 75 | assert_match /#{html.public_filename}/, @response.body |
76 | 76 | end |
77 | 77 | |
78 | + should 'produce a download-link when article is a image' do | |
79 | + profile = create_user('someone').person | |
80 | + image = UploadedFile.create! :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile | |
81 | + image.save! | |
82 | + | |
83 | + get :view_page, :profile => 'someone', :page => [ 'rails.png' ] | |
84 | + | |
85 | + assert_response :success | |
86 | + assert_not_nil assigns(:page).data | |
87 | + assert_match /image/, @response.headers['Content-Type'] | |
88 | + end | |
89 | + | |
78 | 90 | should 'produce a download-link when article is not text/html' do |
79 | 91 | |
80 | 92 | # for example, RSS feeds | ... | ... |