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:
Jean-Philippe Lang
2014-11-22 09:38:21 +00:00
parent 3602cd637c
commit f3e573b5f8
52 changed files with 443 additions and 951 deletions

View File

@@ -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