From f3e573b5f891c71f9395562a3f8747ecec801091 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 22 Nov 2014 09:38:21 +0000 Subject: Replaced remaining #assert_tag with #assert_select. git-svn-id: http://svn.redmine.org/redmine/trunk@13624 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/api_test/attachments_test.rb | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'test/integration/api_test/attachments_test.rb') diff --git a/test/integration/api_test/attachments_test.rb b/test/integration/api_test/attachments_test.rb index e1dc2cf89..5a80f5cc7 100644 --- a/test/integration/api_test/attachments_test.rb +++ b/test/integration/api_test/attachments_test.rb @@ -40,19 +40,10 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base get '/attachments/7.xml', {}, credentials('jsmith') assert_response :success assert_equal 'application/xml', @response.content_type - assert_tag :tag => 'attachment', - :child => { - :tag => 'id', - :content => '7', - :sibling => { - :tag => 'filename', - :content => 'archive.zip', - :sibling => { - :tag => 'content_url', - :content => 'http://www.example.com/attachments/download/7/archive.zip' - } - } - } + assert_select 'attachment id:content(7)' do + assert_select '~ filename', :text => 'archive.zip' + assert_select '~ content_url', :text => 'http://www.example.com/attachments/download/7/archive.zip' + end end test "GET /attachments/:id.xml should deny access without credentials" do @@ -142,7 +133,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base assert_no_difference 'Attachment.count' do post '/uploads.xml', ('x' * 2048), {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials('jsmith')) assert_response 422 - assert_tag 'error', :content => /exceeds the maximum allowed file size/ + assert_select 'error', :text => /exceeds the maximum allowed file size/ end end end -- cgit v1.2.3