diff options
Diffstat (limited to 'test/integration/api_test/time_entries_test.rb')
-rw-r--r-- | test/integration/api_test/time_entries_test.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/test/integration/api_test/time_entries_test.rb b/test/integration/api_test/time_entries_test.rb index 93c42e675..9fa93cd27 100644 --- a/test/integration/api_test/time_entries_test.rb +++ b/test/integration/api_test/time_entries_test.rb @@ -35,24 +35,21 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base get '/time_entries.xml', {}, credentials('jsmith') assert_response :success assert_equal 'application/xml', @response.content_type - assert_tag :tag => 'time_entries', - :child => {:tag => 'time_entry', :child => {:tag => 'id', :content => '2'}} + assert_select 'time_entries[type=array] time_entry id', :text => '2' end test "GET /time_entries.xml with limit should return limited results" do get '/time_entries.xml?limit=2', {}, credentials('jsmith') assert_response :success assert_equal 'application/xml', @response.content_type - assert_tag :tag => 'time_entries', - :children => {:count => 2} + assert_select 'time_entries[type=array] time_entry', 2 end test "GET /time_entries/:id.xml should return the time entry" do get '/time_entries/2.xml', {}, credentials('jsmith') assert_response :success assert_equal 'application/xml', @response.content_type - assert_tag :tag => 'time_entry', - :child => {:tag => 'id', :content => '2'} + assert_select 'time_entry id', :text => '2' end test "POST /time_entries.xml with issue_id should create time entry" do @@ -109,7 +106,7 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base assert_response :unprocessable_entity assert_equal 'application/xml', @response.content_type - assert_tag 'errors', :child => {:tag => 'error', :content => "Hours can't be blank"} + assert_select 'errors error', :text => "Hours can't be blank" end test "PUT /time_entries/:id.xml with valid parameters should update time entry" do @@ -128,7 +125,7 @@ class Redmine::ApiTest::TimeEntriesTest < Redmine::ApiTest::Base assert_response :unprocessable_entity assert_equal 'application/xml', @response.content_type - assert_tag 'errors', :child => {:tag => 'error', :content => "Hours can't be blank"} + assert_select 'errors error', :text => "Hours can't be blank" end test "DELETE /time_entries/:id.xml should destroy time entry" do |