taskrabbit 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,3 +32,38 @@
32
32
  - no-cache
33
33
  body: ! '{"error":"Missing valid client application"}'
34
34
  http_version: '1.1'
35
+ - !ruby/struct:VCR::HTTPInteraction
36
+ request: !ruby/struct:VCR::Request
37
+ method: :get
38
+ uri: https://taskrabbitdev.com:443/api/v1/tasks?include[task][]=errors&include[task][]=links&include[task][]=error&include[task][]=id&include[task][]=name&include[task][]=user&include[task][]=runner&include[task][]=runners&include[task][]=named_price&include[task][]=charge_price&include[task][]=cost_in_cents&include[task][]=number_runners_to_fill&include[task][]=state_label&include[task][]=geography_id&include[task][]=city&include[task][]=description&include[task][]=private_description&include[task][]=private_runner&include[task][]=virtual&include[task][]=state&include[task][]=assignment_type&include[task][]=complete_by_time&include[task][]=state_changed_at&include[task][]=assign_by_time&include[task][]=location_visits&include[task][]=offers&include[task][]=other_locations_attributes&include[task][]=uploaded_photos_attributes&include[task][]=uploaded_sounds_attributes
39
+ body:
40
+ headers:
41
+ x-client-application:
42
+ - ''
43
+ authorization:
44
+ - OAuth
45
+ response: !ruby/struct:VCR::Response
46
+ status: !ruby/struct:VCR::ResponseStatus
47
+ code: 403
48
+ message: Forbidden
49
+ headers:
50
+ server:
51
+ - nginx/1.0.11
52
+ date:
53
+ - Fri, 12 Oct 2012 06:40:36 GMT
54
+ content-type:
55
+ - application/json; charset=utf-8
56
+ status:
57
+ - 403 Forbidden
58
+ cache-control:
59
+ - no-cache
60
+ x-runtime:
61
+ - '0.019463'
62
+ x-ua-compatible:
63
+ - IE=Edge,chrome=1
64
+ strict-transport-security:
65
+ - max-age=31536000
66
+ content-length:
67
+ - '44'
68
+ body: ! '{"error":"Missing valid client application"}'
69
+ http_version: '1.1'
@@ -2,7 +2,7 @@
2
2
  - !ruby/struct:VCR::HTTPInteraction
3
3
  request: !ruby/struct:VCR::Request
4
4
  method: :get
5
- uri: https://taskrabbitdev.com/api/v1/users/40/tasks?include[task][]=errors&include[task][]=links&include[task][]=error&include[task][]=id&include[task][]=name&include[task][]=user&include[task][]=runner&include[task][]=runners&include[task][]=named_price&include[task][]=charge_price&include[task][]=cost_in_cents&include[task][]=number_runners_to_fill&include[task][]=state_label&include[task][]=city_id&include[task][]=city&include[task][]=description&include[task][]=private_description&include[task][]=private_runner&include[task][]=virtual&include[task][]=state&include[task][]=assignment_type&include[task][]=complete_by_time&include[task][]=state_changed_at&include[task][]=assign_by_time&include[task][]=location_visits&include[task][]=offers&include[task][]=other_locations_attributes&include[task][]=uploaded_photos_attributes&include[task][]=uploaded_sounds_attributes
5
+ uri: https://taskrabbitdev.com:443/api/v1/users/40/tasks?include[task][]=errors&include[task][]=links&include[task][]=error&include[task][]=id&include[task][]=name&include[task][]=user&include[task][]=runner&include[task][]=runners&include[task][]=named_price&include[task][]=charge_price&include[task][]=cost_in_cents&include[task][]=number_runners_to_fill&include[task][]=state_label&include[task][]=geography_id&include[task][]=city&include[task][]=description&include[task][]=private_description&include[task][]=private_runner&include[task][]=virtual&include[task][]=state&include[task][]=assignment_type&include[task][]=complete_by_time&include[task][]=state_changed_at&include[task][]=assign_by_time&include[task][]=location_visits&include[task][]=offers&include[task][]=other_locations_attributes&include[task][]=uploaded_photos_attributes&include[task][]=uploaded_sounds_attributes
6
6
  body:
7
7
  headers:
8
8
  x-client-application:
@@ -17,31 +17,53 @@
17
17
  server:
18
18
  - nginx/1.0.11
19
19
  date:
20
- - Wed, 12 Sep 2012 23:03:44 GMT
20
+ - Fri, 12 Oct 2012 06:50:02 GMT
21
21
  content-type:
22
22
  - application/json; charset=utf-8
23
23
  status:
24
24
  - 200 OK
25
+ etag:
26
+ - ! '"d467d9dda95dab5cff4f145171424fc9"'
27
+ cache-control:
28
+ - max-age=0, private, must-revalidate
25
29
  set-cookie:
26
- - current_geo=1053; path=/; expires=Tue, 13-Nov-2012 00:03:44 GMT
30
+ - current_geo=1053; path=/; expires=Wed, 12-Dec-2012 07:50:01 GMT; secure
27
31
  x-runtime:
28
- - '0.242963'
29
- content-length:
30
- - '1552'
31
- etag:
32
- - ! '"bb6fe1c81c51df832fa9f184dc72c50a"'
32
+ - '0.813379'
33
33
  x-ua-compatible:
34
34
  - IE=Edge,chrome=1
35
- cache-control:
36
- - max-age=0, private, must-revalidate
37
- body: ! '{"links":{"first":"/api/v1/users/40/tasks?page=1","last":"/api/v1/users/40/tasks?page=1","get":"/api/v1/users/40/tasks"},"items":[{"links":{"put":"/api/v1/tasks/52","html":"http://s-app1.taskrabbit.com/tasks/house-cleaning-7091","get":"/api/v1/tasks/52","authenticated":"http://s-app1.taskrabbit.com/go/82d359e524666a2d8b96f6df1fbfcad4a720a0b4fed8c3f0985139a13a4d6433b65f7f05e80360af131d8f9638f8307e035b","delete":"/api/v1/tasks/52"},"private_runner":false,"charge_price":23,"runners":{"items":[]},"id":52,"cost_in_cents":0,"state_changed_at":1347490579,"named_price":23,"description":"I
38
- need to clean my house","assignment_type":"auto","name":"House Cleaning","assign_by_time":1347577200,"city":{"links":{"get":"/api/v1/cities/3"},"lat":37.77493,"id":1053,"lng":-122.419416,"name":"SF
39
- Bay Area"},"runner_fee":0,"complete_by_time":1347663600,"state_label":"posted","description_properties":[{"value":"I
40
- need to clean my house","key":"description","title":"Description"},{"value":null,"key":"private_description","title":"Private
41
- description"},{"value":"Regular Maintenance","key":"task_field_16","title":"Level
42
- of cleaning"},{"value":"Multiple Rooms, 1 Bathroom","key":"task_field_17","title":"Size
43
- of house"},{"value":"Cleaning supplies are already in the house","key":"task_field_18","title":"Do
44
- you have all the necessary cleaning supplies at your house"},{"value":1347577200,"key":"assign_by_time","title":"If
45
- unassigned, Task will expire on"},{"value":1347663600,"key":"complete_by_time","title":"Task
46
- should be completed by"}],"state":"opened"}]}'
35
+ strict-transport-security:
36
+ - max-age=31536000
37
+ content-length:
38
+ - '8307'
39
+ body: ! '{"items":[{"id":132,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1701465000,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
40
+ First Task","state_changed_at":1349847538,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
41
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1702411800,"links":{"put":"/api/v1/tasks/132","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--15","get":"/api/v1/tasks/132","authenticated":"http://s-app1.taskrabbit.com/go/f628a10b1384beb11bd617706d93ecec821e47520a27c9cd0b71f64399e289ec3d66c5d247d6248768f2a5fb47a7267e7360","delete":"/api/v1/tasks/132"}},{"id":131,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1701465000,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
42
+ First Task","state_changed_at":1349847522,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
43
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1702411800,"links":{"put":"/api/v1/tasks/131","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--14","get":"/api/v1/tasks/131","authenticated":"http://s-app1.taskrabbit.com/go/5c6933037d30c2f6e76efbe1a67b013d0211c1199f60a01221c7883fe9621ca894f4dc723a01ba9c10b9743067af593083db","delete":"/api/v1/tasks/131"}},{"id":130,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1701465000,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
44
+ First Task","state_changed_at":1349847489,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
45
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1702411800,"links":{"put":"/api/v1/tasks/130","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--13","get":"/api/v1/tasks/130","authenticated":"http://s-app1.taskrabbit.com/go/3bd73d5b9985872d7653dfc6c0167bbd5b5f5eb639074ab503af8c3af59fe3dfe1635cbb9a0e313d187ed3e1edcc3b11e5f4","delete":"/api/v1/tasks/130"}},{"id":129,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1349967600,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
46
+ First Task","state_changed_at":1349846366,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
47
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1350054000,"links":{"put":"/api/v1/tasks/129","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--12","get":"/api/v1/tasks/129","authenticated":"http://s-app1.taskrabbit.com/go/e817145624145f9f56a6f91512df237f9aa5b0eec61552e5ededcd2ec10b4808d77aaa3b2b77c20a67df9406efda6ef4c059","delete":"/api/v1/tasks/129"}},{"id":128,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1349967600,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
48
+ First Task","state_changed_at":1349845814,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
49
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1350054000,"links":{"put":"/api/v1/tasks/128","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--11","get":"/api/v1/tasks/128","authenticated":"http://s-app1.taskrabbit.com/go/f8fa19d12f798f1a41ed64c16f30f3dd8acae33ac85c54da5c6d2332930ce73fac93986272784822ccef4d6c6e2609ead538","delete":"/api/v1/tasks/128"}},{"id":127,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1349967600,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
50
+ First Task","state_changed_at":1349845803,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
51
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1350054000,"links":{"put":"/api/v1/tasks/127","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--10","get":"/api/v1/tasks/127","authenticated":"http://s-app1.taskrabbit.com/go/3558774ebd06622a5abba64f122f6be8ff42f078e2519940b52ed773487edbe55f4bf3bbb2104eb6bdfb76e7dc4c46aef1ad","delete":"/api/v1/tasks/127"}},{"id":126,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1349967600,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
52
+ First Task","state_changed_at":1349845784,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
53
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1350054000,"links":{"put":"/api/v1/tasks/126","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--9","get":"/api/v1/tasks/126","authenticated":"http://s-app1.taskrabbit.com/go/7d0f998b5d25d012e0673962418daac1b4823bd5ad44e580f575d692ea510dd3c34fd5eac8a9d8437ec08430ff6cd5e8d9c0","delete":"/api/v1/tasks/126"}},{"id":125,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1349967600,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
54
+ First Task","state_changed_at":1349845773,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
55
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1350054000,"links":{"put":"/api/v1/tasks/125","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--8","get":"/api/v1/tasks/125","authenticated":"http://s-app1.taskrabbit.com/go/9701072d4de97effc834d9a54580b9e2b767d27d66fb9a3c9284298c531e2e8a686c4b740f5bb2c8a05f1248b94543b9b05f","delete":"/api/v1/tasks/125"}},{"id":124,"charge_price":20,"named_price":20,"runners":{"items":[]},"location_visits":{"items":[]},"assign_by_time":1349967600,"cost_in_cents":0,"state_label":"posted","assignment_type":"auto","name":"My
56
+ First Task","state_changed_at":1349845743,"city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New
57
+ York City","links":{"get":"/api/v1/cities/4"}},"state":"opened","private_runner":false,"complete_by_time":1350054000,"links":{"put":"/api/v1/tasks/124","html":"http://s-app1.taskrabbit.com/tasks/my-first-task--7","get":"/api/v1/tasks/124","authenticated":"http://s-app1.taskrabbit.com/go/4c9773d7fbd52647bf1a152dc5d34a4170b94a8d7ad968374ce2edc3bef7b54470dacc05acd50f8c95c284842c67a65bf247","delete":"/api/v1/tasks/124"}},{"id":52,"charge_price":0,"runners":{"items":[]},"location_visits":{"items":[{"id":11,"zip":"94102","lng":-122.4080542,"approximate_radius":0,"address":"213
58
+ Powell Street, San Francisco, CA","lat":37.7867363,"name":"Home","city":"San
59
+ Francisco","complete":"213 Powell Street, San Francisco, CA, San Francisco,
60
+ CA 94102","location_id":52,"state":"CA","partial":"Powell Street, San Francisco,
61
+ CA, San Francisco, CA 94102"}]},"assign_by_time":1347577200,"cost_in_cents":0,"description":"I
62
+ need to clean my house","state_label":"posted","assignment_type":"review","name":"House
63
+ Cleaning","state_changed_at":1347490579,"city":{"id":1053,"lng":-122.419416,"lat":37.77493,"name":"SF
64
+ Bay Area","links":{"get":"/api/v1/cities/3"}},"offers":{"items":[{"charge_price":26,"id":7,"runner_id":32,"runner":{"id":32,"short_name":"John","runner_level":1,"display_name":"John
65
+ R.","city":{"id":1060,"lng":-74.005973,"lat":40.714353,"name":"New York City","links":{"get":"/api/v1/cities/4"}},"mobile_phone":"856
66
+ 938 6494","runner":true,"email":"fancyrabbit@example.com","full_name":"John
67
+ R.","friend_code_url":"http://taskrabbit.com/PAL/32","links":{"avatar_url":"http://s-app1.taskrabbit.com/images/default_avatars/runner_thumb.png","get":"/api/v1/users/32"}},"state":"sent","comments":"I
68
+ clean a lot!","created_at":1347493865}]},"state":"opened","private_runner":false,"complete_by_time":1347663600,"links":{"put":"/api/v1/tasks/52","html":"http://s-app1.taskrabbit.com/tasks/house-cleaning-7091","offers":"/api/v1/tasks/52/offers","get":"/api/v1/tasks/52","authenticated":"http://s-app1.taskrabbit.com/go/82d359e524666a2d8b96f6df1fbfcad4a720a0b4fed8c3f0985139a13a4d6433b65f7f05e80360af131d8f9638f8307e035b","delete":"/api/v1/tasks/52"}}]}'
47
69
  http_version: '1.1'
@@ -18,6 +18,6 @@ describe Taskrabbit::Location do
18
18
  its(:id ) { should == 7 }
19
19
  its(:charge_price ) { should == 26 }
20
20
  its(:state ) { should == "sent" }
21
- its(:runner_id ) { should == 31 }
21
+ its(:runner_id ) { should == 32 }
22
22
  end
23
23
  end
@@ -29,7 +29,7 @@ describe Taskrabbit::Task do
29
29
  its(:virtual) { should == false }
30
30
  its(:state) { should == 'opened' }
31
31
  its(:state_label) { should == 'posted' }
32
- its(:location_visits) { should be_nil }
32
+ its(:location_visits) { should be_a(Taskrabbit::Collection) }
33
33
  its(:city) { should be_instance_of(Taskrabbit::City) }
34
34
  its(:assign_by_time) { should be_instance_of(Time) }
35
35
  its(:complete_by_time) { should be_instance_of(Time) }
@@ -47,7 +47,7 @@ describe Taskrabbit::Task do
47
47
  {
48
48
  "name" => "My First Task",
49
49
  "named_price" => 20,
50
- "city_id" => 4
50
+ "geography_id" => 4
51
51
  }
52
52
  }
53
53
 
@@ -261,8 +261,10 @@ describe Taskrabbit::Task do
261
261
  }
262
262
  ]})
263
263
  expect { tr_task = tr.tasks.create(params_with_locations) }.to_not raise_error
264
+
264
265
  tr_task.should be_instance_of(Taskrabbit::Task)
265
266
  tr_task.location_visits.count.should == 2
267
+ tr_task.keys.should_not include('other_locations_attributes')
266
268
  end
267
269
  end
268
270
  end
@@ -57,7 +57,7 @@ describe Taskrabbit::User do
57
57
  end
58
58
 
59
59
  it "should fetch tasks with users/#{TR_USERS[:with_card][:id]}/tasks" do
60
- VCR.use_cassette('users/tasks/all', :record => :none) do
60
+ VCR.use_cassette('users/tasks/all', :record => :new_episodes) do
61
61
  tr_tasks = nil
62
62
  expect { tr_tasks = tr.users.find(TR_USERS[:with_card][:id]).tasks.all }.to_not raise_error
63
63
  tr_tasks.should be_a(Taskrabbit::Collection)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taskrabbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-11 00:00:00.000000000 Z
12
+ date: 2012-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: api_smith
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  segments:
165
165
  - 0
166
- hash: 1528274939579019279
166
+ hash: 3960350268990791789
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  none: false
169
169
  requirements: