Commit 0ef6613255abfdbb705eec678c3cb87fae98b970

Authored by Rodrigo Souto
1 parent 67f6ebd9

content-viewer-controller-test: adapt tests to new file_presenter infras

test/functional/content_viewer_controller_test.rb
... ... @@ -72,9 +72,7 @@ class ContentViewerControllerTest < ActionController::TestCase
72 72 get :view_page, :profile => 'someone', :page => [ '500.html' ]
73 73  
74 74 assert_response :success
75   - assert_match /^text\/html/, @response.headers['Content-Type']
76   - assert @response.headers['Content-Disposition'].present?
77   - assert_match /attachment/, @response.headers['Content-Disposition']
  75 + assert_match /#{html.public_filename}/, @response.body
78 76 end
79 77  
80 78 should 'produce a download-link when article is not text/html' do
... ... @@ -548,14 +546,6 @@ class ContentViewerControllerTest < ActionController::TestCase
548 546 assert_template 'view_page'
549 547 end
550 548  
551   - should 'download data for image when not view' do
552   - file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile)
553   - get :view_page, :profile => profile.identifier, :page => file.explode_path
554   -
555   - assert_response :success
556   - assert_template nil
557   - end
558   -
559 549 should "display 'Upload files' when create children of image gallery" do
560 550 login_as(profile.identifier)
561 551 f = Gallery.create!(:name => 'gallery', :profile => profile)
... ... @@ -1299,8 +1289,8 @@ class ContentViewerControllerTest < ActionController::TestCase
1299 1289  
1300 1290 should 'display link to download of non-recognized file types on its page' do
1301 1291 file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'bin/unknown'), :profile => profile)
1302   - get :view_page, file.url.merge(:view=>:true)
1303   - assert_match /this is a sample text file/, @response.body
  1292 + get :view_page, file.url
  1293 + assert_match /#{file.public_filename}/, @response.body
1304 1294 end
1305 1295  
1306 1296 should 'not count hit from bots' do
... ...