public
Description: Keep track of your time on FreshBooks
Homepage: http://b.logi.cx/2008/1/31/laying-down-fresh-tracks
Clone URL: git://github.com/flogic/freshtrack.git
Modified FreshBooks::TimeEntry to work with the listing change in the 2.1 
API.
ymendel (author)
Wed Feb 27 11:20:01 -0800 2008
commit  3cd9058a96e81bcd0f1c78b94b67d939325c7821
tree    d30b0516b15612d361f81dce0dc846f1e85180eb
parent  851981836572cc1b17059252203280bd78791a46
...
17
18
19
20
 
 
21
22
23
...
17
18
19
 
20
21
22
23
24
0
@@ -17,7 +17,8 @@ module FreshBooks
0
       def list(options = {})
0
         resp = FreshBooks.call_api('time_entry.list', options)
0
         return nil unless resp.success?
0
- resp.elements.collect { |elem| new_from_xml(elem) }
0
+ list_elements = resp.elements[1].elements
0
+ list_elements.collect { |elem| new_from_xml(elem) }
0
       end
0
       
0
       def delete(time_entry_id)
...
251
252
253
254
255
 
 
256
257
258
...
251
252
253
 
 
254
255
256
257
258
0
@@ -251,8 +251,8 @@ describe FreshBooks::TimeEntry do
0
   describe 'getting a list' do
0
     before :each do
0
       @time_entry_id = 1
0
- @elements = Array.new(3) { stub('element') }
0
- @response = stub('response', :elements => @elements, :success? => nil)
0
+ @elements = Array.new(3) { stub('list element') }
0
+ @response = stub('response', :elements => [stub('pre element'), stub('element', :elements => @elements), stub('post element')], :success? => nil)
0
       FreshBooks.stubs(:call_api).returns(@response)
0
     end
0
     

Comments

    No one has commented yet.