##// END OF EJS Templates
Fixed attachment fixture (should be attached to issue 3 because one of its journals references it), r13937....
Jean-Philippe Lang -
r13560:b50fa8fec19b
parent child
Show More
@@ -42,7 +42,7 attachments_003:
42 attachments_004:
42 attachments_004:
43 created_on: 2006-07-19 21:07:27 +02:00
43 created_on: 2006-07-19 21:07:27 +02:00
44 container_type: Issue
44 container_type: Issue
45 container_id: 3
45 container_id: 2
46 downloads: 0
46 downloads: 0
47 disk_filename: 060719210727_source.rb
47 disk_filename: 060719210727_source.rb
48 disk_directory: "2006/07"
48 disk_directory: "2006/07"
@@ -329,15 +329,15 class AttachmentsControllerTest < ActionController::TestCase
329
329
330 def test_edit
330 def test_edit
331 @request.session[:user_id] = 2
331 @request.session[:user_id] = 2
332 get :edit, :object_type => 'issues', :object_id => '3'
332 get :edit, :object_type => 'issues', :object_id => '2'
333 assert_response :success
333 assert_response :success
334 assert_template 'edit'
334 assert_template 'edit'
335
335
336 container = Issue.find(3)
336 container = Issue.find(2)
337 assert_equal container, assigns(:container)
337 assert_equal container, assigns(:container)
338 assert_equal container.attachments.size, assigns(:attachments).size
338 assert_equal container.attachments.size, assigns(:attachments).size
339
339
340 assert_select 'form[action=?]', '/attachments/issues/3' do
340 assert_select 'form[action=?]', '/attachments/issues/2' do
341 assert_select 'tr#attachment-4' do
341 assert_select 'tr#attachment-4' do
342 assert_select 'input[name=?][value=?]', 'attachments[4][filename]', 'source.rb'
342 assert_select 'input[name=?][value=?]', 'attachments[4][filename]', 'source.rb'
343 assert_select 'input[name=?][value=?]', 'attachments[4][description]', 'This is a Ruby source file'
343 assert_select 'input[name=?][value=?]', 'attachments[4][description]', 'This is a Ruby source file'
@@ -362,7 +362,7 class AttachmentsControllerTest < ActionController::TestCase
362
362
363 def test_update
363 def test_update
364 @request.session[:user_id] = 2
364 @request.session[:user_id] = 2
365 patch :update, :object_type => 'issues', :object_id => '3', :attachments => {
365 patch :update, :object_type => 'issues', :object_id => '2', :attachments => {
366 '1' => {:filename => 'newname.text', :description => ''},
366 '1' => {:filename => 'newname.text', :description => ''},
367 '4' => {:filename => 'newname.rb', :description => 'Renamed'},
367 '4' => {:filename => 'newname.rb', :description => 'Renamed'},
368 }
368 }
@@ -280,10 +280,10 class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
280 get '/issues/3.xml?include=attachments'
280 get '/issues/3.xml?include=attachments'
281
281
282 assert_select 'issue attachments[type=array]' do
282 assert_select 'issue attachments[type=array]' do
283 assert_select 'attachment', 5
283 assert_select 'attachment', 4
284 assert_select 'attachment id', :text => '4' do
284 assert_select 'attachment id', :text => '1' do
285 assert_select '~ filename', :text => 'source.rb'
285 assert_select '~ filename', :text => 'error281.txt'
286 assert_select '~ content_url', :text => 'http://www.example.com/attachments/download/4/source.rb'
286 assert_select '~ content_url', :text => 'http://www.example.com/attachments/download/1/error281.txt'
287 end
287 end
288 end
288 end
289 end
289 end
General Comments 0
You need to be logged in to leave comments. Login now