mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 22:05:56 +01:00
Replaced remaining #assert_tag with #assert_select.
git-svn-id: http://svn.redmine.org/redmine/trunk@13624 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -36,19 +36,10 @@ class Redmine::ApiTest::VersionsTest < Redmine::ApiTest::Base
|
||||
|
||||
assert_response :success
|
||||
assert_equal 'application/xml', @response.content_type
|
||||
assert_tag :tag => 'versions',
|
||||
:attributes => {:type => 'array'},
|
||||
:child => {
|
||||
:tag => 'version',
|
||||
:child => {
|
||||
:tag => 'id',
|
||||
:content => '2',
|
||||
:sibling => {
|
||||
:tag => 'name',
|
||||
:content => '1.0'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert_select 'versions[type=array] version id:content(2)' do
|
||||
assert_select '~ name', :text => '1.0'
|
||||
end
|
||||
end
|
||||
|
||||
test "POST /projects/:project_id/versions.xml should create the version" do
|
||||
@@ -61,7 +52,7 @@ class Redmine::ApiTest::VersionsTest < Redmine::ApiTest::Base
|
||||
|
||||
assert_response :created
|
||||
assert_equal 'application/xml', @response.content_type
|
||||
assert_tag 'version', :child => {:tag => 'id', :content => version.id.to_s}
|
||||
assert_select 'version id', :text => version.id.to_s
|
||||
end
|
||||
|
||||
test "POST /projects/:project_id/versions.xml should create the version with due date" do
|
||||
@@ -75,7 +66,7 @@ class Redmine::ApiTest::VersionsTest < Redmine::ApiTest::Base
|
||||
|
||||
assert_response :created
|
||||
assert_equal 'application/xml', @response.content_type
|
||||
assert_tag 'version', :child => {:tag => 'id', :content => version.id.to_s}
|
||||
assert_select 'version id', :text => version.id.to_s
|
||||
end
|
||||
|
||||
test "POST /projects/:project_id/versions.xml should create the version with custom fields" do
|
||||
@@ -107,7 +98,7 @@ class Redmine::ApiTest::VersionsTest < Redmine::ApiTest::Base
|
||||
end
|
||||
|
||||
assert_response :unprocessable_entity
|
||||
assert_tag :errors, :child => {:tag => 'error', :content => "Name can't be blank"}
|
||||
assert_select 'errors error', :text => "Name can't be blank"
|
||||
end
|
||||
|
||||
test "GET /versions/:id.xml should return the version" do
|
||||
|
||||
Reference in New Issue
Block a user