mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 14:26:04 +01:00
Fixed attachment fixture (should be attached to issue 3 because one of its journals references it), r13937.
git-svn-id: http://svn.redmine.org/redmine/trunk@13942 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
2
test/fixtures/attachments.yml
vendored
2
test/fixtures/attachments.yml
vendored
@@ -42,7 +42,7 @@ attachments_003:
|
|||||||
attachments_004:
|
attachments_004:
|
||||||
created_on: 2006-07-19 21:07:27 +02:00
|
created_on: 2006-07-19 21:07:27 +02:00
|
||||||
container_type: Issue
|
container_type: Issue
|
||||||
container_id: 3
|
container_id: 2
|
||||||
downloads: 0
|
downloads: 0
|
||||||
disk_filename: 060719210727_source.rb
|
disk_filename: 060719210727_source.rb
|
||||||
disk_directory: "2006/07"
|
disk_directory: "2006/07"
|
||||||
|
|||||||
@@ -329,15 +329,15 @@ class AttachmentsControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
def test_edit
|
def test_edit
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
get :edit, :object_type => 'issues', :object_id => '3'
|
get :edit, :object_type => 'issues', :object_id => '2'
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'edit'
|
assert_template 'edit'
|
||||||
|
|
||||||
container = Issue.find(3)
|
container = Issue.find(2)
|
||||||
assert_equal container, assigns(:container)
|
assert_equal container, assigns(:container)
|
||||||
assert_equal container.attachments.size, assigns(:attachments).size
|
assert_equal container.attachments.size, assigns(:attachments).size
|
||||||
|
|
||||||
assert_select 'form[action=?]', '/attachments/issues/3' do
|
assert_select 'form[action=?]', '/attachments/issues/2' do
|
||||||
assert_select 'tr#attachment-4' do
|
assert_select 'tr#attachment-4' do
|
||||||
assert_select 'input[name=?][value=?]', 'attachments[4][filename]', 'source.rb'
|
assert_select 'input[name=?][value=?]', 'attachments[4][filename]', 'source.rb'
|
||||||
assert_select 'input[name=?][value=?]', 'attachments[4][description]', 'This is a Ruby source file'
|
assert_select 'input[name=?][value=?]', 'attachments[4][description]', 'This is a Ruby source file'
|
||||||
@@ -362,7 +362,7 @@ class AttachmentsControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
def test_update
|
def test_update
|
||||||
@request.session[:user_id] = 2
|
@request.session[:user_id] = 2
|
||||||
patch :update, :object_type => 'issues', :object_id => '3', :attachments => {
|
patch :update, :object_type => 'issues', :object_id => '2', :attachments => {
|
||||||
'1' => {:filename => 'newname.text', :description => ''},
|
'1' => {:filename => 'newname.text', :description => ''},
|
||||||
'4' => {:filename => 'newname.rb', :description => 'Renamed'},
|
'4' => {:filename => 'newname.rb', :description => 'Renamed'},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,10 +280,10 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
|
|||||||
get '/issues/3.xml?include=attachments'
|
get '/issues/3.xml?include=attachments'
|
||||||
|
|
||||||
assert_select 'issue attachments[type=array]' do
|
assert_select 'issue attachments[type=array]' do
|
||||||
assert_select 'attachment', 5
|
assert_select 'attachment', 4
|
||||||
assert_select 'attachment id', :text => '4' do
|
assert_select 'attachment id', :text => '1' do
|
||||||
assert_select '~ filename', :text => 'source.rb'
|
assert_select '~ filename', :text => 'error281.txt'
|
||||||
assert_select '~ content_url', :text => 'http://www.example.com/attachments/download/4/source.rb'
|
assert_select '~ content_url', :text => 'http://www.example.com/attachments/download/1/error281.txt'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user