From 0ef6613255abfdbb705eec678c3cb87fae98b970 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Tue, 1 Apr 2014 18:35:04 +0000 Subject: [PATCH] content-viewer-controller-test: adapt tests to new file_presenter infras --- test/functional/content_viewer_controller_test.rb | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 9c767b5..cfe704f 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -72,9 +72,7 @@ class ContentViewerControllerTest < ActionController::TestCase get :view_page, :profile => 'someone', :page => [ '500.html' ] assert_response :success - assert_match /^text\/html/, @response.headers['Content-Type'] - assert @response.headers['Content-Disposition'].present? - assert_match /attachment/, @response.headers['Content-Disposition'] + assert_match /#{html.public_filename}/, @response.body end should 'produce a download-link when article is not text/html' do @@ -548,14 +546,6 @@ class ContentViewerControllerTest < ActionController::TestCase assert_template 'view_page' end - should 'download data for image when not view' do - file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :profile => profile) - get :view_page, :profile => profile.identifier, :page => file.explode_path - - assert_response :success - assert_template nil - end - should "display 'Upload files' when create children of image gallery" do login_as(profile.identifier) f = Gallery.create!(:name => 'gallery', :profile => profile) @@ -1299,8 +1289,8 @@ class ContentViewerControllerTest < ActionController::TestCase should 'display link to download of non-recognized file types on its page' do file = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'bin/unknown'), :profile => profile) - get :view_page, file.url.merge(:view=>:true) - assert_match /this is a sample text file/, @response.body + get :view_page, file.url + assert_match /#{file.public_filename}/, @response.body end should 'not count hit from bots' do -- libgit2 0.21.2