Project

General

Profile

Defect #14990 » 0002-Add-an-API-test-for-sorting-time-entries-by-updated_.patch

Go MAEDA, 2026-09-20 08:12

View differences:

test/integration/api_test/time_entries_test.rb
36 36
    assert_select 'time_entries[type=array] time_entry', 2
37 37
  end
38
  test "GET /time_entries.xml with sort by updated_on should return sorted results" do
39
    TimeEntry.where(:id => 2).update_all(:updated_on => '2012-06-16 20:00:00')
40

  
41
    get '/time_entries.xml?sort=updated_on:desc', :headers => credentials('jsmith')
42
    assert_response :success
43
    assert_equal '2', css_select('time_entries > time_entry > id').first.text
44
  end
45

  
38 46
  test "GET /time_entries/:id.xml should return the time entry" do
39 47
    get '/time_entries/4.xml', :headers => credentials('jsmith')
40 48
    assert_response :success
(2-2/2)