summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 14:56:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-10 14:56:29 +0000
commitac8a67191f4a104ebc4c10847a3c29a549a501c0 (patch)
tree89576ed668b1e16056fd40cab43b983c590a0f1d
parent94d34887cca99261bc8989688ab2c1f60fc35b3b (diff)
downloadredmine-ac8a67191f4a104ebc4c10847a3c29a549a501c0.tar.gz
redmine-ac8a67191f4a104ebc4c10847a3c29a549a501c0.zip
Renames uploaded_test_file helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2909 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/functional/documents_controller_test.rb2
-rw-r--r--test/functional/issues_controller_test.rb2
-rw-r--r--test/functional/projects_controller_test.rb4
-rw-r--r--test/integration/issues_test.rb2
-rw-r--r--test/test_helper.rb2
-rw-r--r--test/unit/attachment_test.rb4
6 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/documents_controller_test.rb b/test/functional/documents_controller_test.rb
index 11c706596..bdab5ac1a 100644
--- a/test/functional/documents_controller_test.rb
+++ b/test/functional/documents_controller_test.rb
@@ -75,7 +75,7 @@ class DocumentsControllerTest < ActionController::TestCase
:document => { :title => 'DocumentsControllerTest#test_post_new',
:description => 'This is a new document',
:category_id => 2},
- :attachments => {'1' => {'file' => test_uploaded_file('testfile.txt', 'text/plain')}}
+ :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_redirected_to 'projects/ecookbook/documents'
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 0d282c127..0c5017251 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -787,7 +787,7 @@ class IssuesControllerTest < ActionController::TestCase
post :edit,
:id => 1,
:notes => '',
- :attachments => {'1' => {'file' => test_uploaded_file('testfile.txt', 'text/plain')}}
+ :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_redirected_to :action => 'show', :id => '1'
j = Issue.find(1).journals.find(:first, :order => 'id DESC')
assert j.notes.blank?
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 1009a46ab..8209c85f7 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -272,7 +272,7 @@ class ProjectsControllerTest < ActionController::TestCase
assert_difference 'Attachment.count' do
post :add_file, :id => 1, :version_id => '',
- :attachments => {'1' => {'file' => test_uploaded_file('testfile.txt', 'text/plain')}}
+ :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
end
assert_redirected_to 'projects/ecookbook/files'
a = Attachment.find(:first, :order => 'created_on DESC')
@@ -303,7 +303,7 @@ class ProjectsControllerTest < ActionController::TestCase
assert_difference 'Attachment.count' do
post :add_file, :id => 1, :version_id => '2',
- :attachments => {'1' => {'file' => test_uploaded_file('testfile.txt', 'text/plain')}}
+ :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
end
assert_redirected_to 'projects/ecookbook/files'
a = Attachment.find(:first, :order => 'created_on DESC')
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb
index 9a73252b4..0a35e139e 100644
--- a/test/integration/issues_test.rb
+++ b/test/integration/issues_test.rb
@@ -71,7 +71,7 @@ class IssuesTest < ActionController::IntegrationTest
post 'issues/1/edit',
:notes => 'Some notes',
- :attachments => {'1' => {'file' => test_uploaded_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}}
+ :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}}
assert_redirected_to "issues/1"
# make sure attachment was saved
diff --git a/test/test_helper.rb b/test/test_helper.rb
index fba2987d3..308b43097 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -54,7 +54,7 @@ class ActiveSupport::TestCase
assert_equal login, User.find(session[:user_id]).login
end
- def test_uploaded_file(name, mime)
+ def uploaded_test_file(name, mime)
ActionController::TestUploadedFile.new(ActiveSupport::TestCase.fixture_path + "/files/#{name}", mime)
end
diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb
index 75a7a3c90..4ae8964f1 100644
--- a/test/unit/attachment_test.rb
+++ b/test/unit/attachment_test.rb
@@ -25,14 +25,14 @@ class AttachmentTest < ActiveSupport::TestCase
def test_create
a = Attachment.new(:container => Issue.find(1),
- :file => test_uploaded_file("testfile.txt", "text/plain"),
+ :file => uploaded_test_file("testfile.txt", "text/plain"),
:author => User.find(1))
assert a.save
assert_equal 'testfile.txt', a.filename
assert_equal 59, a.filesize
assert_equal 'text/plain', a.content_type
assert_equal 0, a.downloads
- assert_equal Digest::MD5.hexdigest(test_uploaded_file("testfile.txt", "text/plain").read), a.digest
+ assert_equal Digest::MD5.hexdigest(uploaded_test_file("testfile.txt", "text/plain").read), a.digest
assert File.exist?(a.diskfile)
end