parse_resource 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. data/.travis.yml +6 -0
  2. data/Gemfile +5 -1
  3. data/Gemfile.lock +11 -1
  4. data/README.md +21 -8
  5. data/VERSION +1 -1
  6. data/fixtures/vcr_cassettes/test_all.yml +161 -0
  7. data/fixtures/vcr_cassettes/test_attribute_getters.yml +57 -0
  8. data/fixtures/vcr_cassettes/test_attribute_setters.yml +57 -0
  9. data/fixtures/vcr_cassettes/test_authenticate.yml +155 -0
  10. data/fixtures/vcr_cassettes/test_chained_wheres.yml +161 -0
  11. data/fixtures/vcr_cassettes/test_count.yml +411 -0
  12. data/fixtures/vcr_cassettes/test_create.yml +57 -0
  13. data/fixtures/vcr_cassettes/test_created_at.yml +57 -0
  14. data/fixtures/vcr_cassettes/test_destroy.yml +157 -0
  15. data/fixtures/vcr_cassettes/test_destroy_all.yml +207 -0
  16. data/fixtures/vcr_cassettes/test_each.yml +269 -0
  17. data/fixtures/vcr_cassettes/test_find.yml +107 -0
  18. data/fixtures/vcr_cassettes/test_find_all_by.yml +157 -0
  19. data/fixtures/vcr_cassettes/test_find_by.yml +157 -0
  20. data/fixtures/vcr_cassettes/test_first.yml +107 -0
  21. data/fixtures/vcr_cassettes/test_id.yml +57 -0
  22. data/fixtures/vcr_cassettes/test_limit.yml +864 -0
  23. data/fixtures/vcr_cassettes/test_map.yml +269 -0
  24. data/fixtures/vcr_cassettes/test_save.yml +111 -0
  25. data/fixtures/vcr_cassettes/test_skip.yml +843 -0
  26. data/fixtures/vcr_cassettes/test_update.yml +111 -0
  27. data/fixtures/vcr_cassettes/test_updated_at.yml +111 -0
  28. data/fixtures/vcr_cassettes/test_username_should_be_unique.yml +109 -0
  29. data/fixtures/vcr_cassettes/test_where.yml +107 -0
  30. data/lib/parse_resource/base.rb +66 -69
  31. data/lib/parse_resource/parse_user.rb +1 -1
  32. data/lib/parse_resource/query.rb +9 -9
  33. data/parse_resource.gemspec +41 -7
  34. data/parse_resource.yml +12 -0
  35. data/test/active_model_lint_test.rb +5 -6
  36. data/test/helper.rb +8 -0
  37. data/test/test_parse_resource.rb +183 -117
  38. data/test/test_parse_user.rb +39 -32
  39. data/test/test_query_options.rb +43 -17
  40. metadata +149 -26
  41. data/test/test_associations.rb +0 -105
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Spoon
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"length":"1234567890created!"}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '31'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - https://parse.com, https://www.parse.com
27
+ Access-Control-Request-Method:
28
+ - ! '*'
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Date:
34
+ - Thu, 20 Sep 2012 04:31:41 GMT
35
+ Location:
36
+ - https://api.parse.com/1/classes/Spoon/qTvSODGDAF
37
+ Server:
38
+ - nginx/1.2.2
39
+ Set-Cookie:
40
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlM2ZmZWQwZWYwMjY2ZTg2YWRmYTc4NjMwOGUxMzA2YzA%3D--dfd395ae98106c61f5972f9386895345f198a169;
41
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:41 GMT; HttpOnly
42
+ Status:
43
+ - 201 Created
44
+ X-Runtime:
45
+ - '0.028833'
46
+ X-Ua-Compatible:
47
+ - IE=Edge,chrome=1
48
+ Content-Length:
49
+ - '64'
50
+ Connection:
51
+ - keep-alive
52
+ body:
53
+ encoding: US-ASCII
54
+ string: ! '{"createdAt":"2012-09-20T04:31:41.056Z","objectId":"qTvSODGDAF"}'
55
+ http_version:
56
+ recorded_at: Thu, 20 Sep 2012 04:31:41 GMT
57
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Post
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"title":"testing created_at"}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '30'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - https://parse.com, https://www.parse.com
27
+ Access-Control-Request-Method:
28
+ - ! '*'
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Date:
34
+ - Thu, 20 Sep 2012 04:31:41 GMT
35
+ Location:
36
+ - https://api.parse.com/1/classes/Post/0oivuHzQvJ
37
+ Server:
38
+ - nginx/1.2.2
39
+ Set-Cookie:
40
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlOTA1MGEwMTQ3YTcwZTA4OGYxNWQzZGExMGY1YzJjZjY%3D--6fb8e314f4a8e8f43ef88e4da3c31c26b4a4004d;
41
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:41 GMT; HttpOnly
42
+ Status:
43
+ - 201 Created
44
+ X-Runtime:
45
+ - '0.026637'
46
+ X-Ua-Compatible:
47
+ - IE=Edge,chrome=1
48
+ Content-Length:
49
+ - '64'
50
+ Connection:
51
+ - keep-alive
52
+ body:
53
+ encoding: US-ASCII
54
+ string: ! '{"createdAt":"2012-09-20T04:31:41.315Z","objectId":"0oivuHzQvJ"}'
55
+ http_version:
56
+ recorded_at: Thu, 20 Sep 2012 04:31:41 GMT
57
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,157 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Post
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"title":"hello1234567890abc!"}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '31'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - https://parse.com, https://www.parse.com
27
+ Access-Control-Request-Method:
28
+ - ! '*'
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Date:
34
+ - Thu, 20 Sep 2012 04:31:41 GMT
35
+ Location:
36
+ - https://api.parse.com/1/classes/Post/HJtVz2Facc
37
+ Server:
38
+ - nginx/1.2.2
39
+ Set-Cookie:
40
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlYWFjMGI1Nzk4ZWNiY2NmNTI0ZWM0MmY3ODlhMDhhM2U%3D--db82503591fc5776b873305c70aa2004f4bed24d;
41
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:41 GMT; HttpOnly
42
+ Status:
43
+ - 201 Created
44
+ X-Runtime:
45
+ - '0.017814'
46
+ X-Ua-Compatible:
47
+ - IE=Edge,chrome=1
48
+ Content-Length:
49
+ - '64'
50
+ Connection:
51
+ - keep-alive
52
+ body:
53
+ encoding: US-ASCII
54
+ string: ! '{"createdAt":"2012-09-20T04:31:41.537Z","objectId":"HJtVz2Facc"}'
55
+ http_version:
56
+ recorded_at: Thu, 20 Sep 2012 04:31:41 GMT
57
+ - request:
58
+ method: delete
59
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Post/HJtVz2Facc
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ''
63
+ headers:
64
+ Accept:
65
+ - ! '*/*; q=0.5, application/xml'
66
+ Accept-Encoding:
67
+ - gzip, deflate
68
+ User-Agent:
69
+ - Ruby
70
+ response:
71
+ status:
72
+ code: 200
73
+ message: OK
74
+ headers:
75
+ Access-Control-Allow-Origin:
76
+ - https://parse.com, https://www.parse.com
77
+ Access-Control-Request-Method:
78
+ - ! '*'
79
+ Cache-Control:
80
+ - max-age=0, private, must-revalidate
81
+ Content-Type:
82
+ - application/json; charset=utf-8
83
+ Date:
84
+ - Thu, 20 Sep 2012 04:31:41 GMT
85
+ Etag:
86
+ - ! '"99914b932bd37a50b983c5e7c90ae93b"'
87
+ Server:
88
+ - nginx/1.2.2
89
+ Set-Cookie:
90
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlZWMxN2JkYTBiNGZiMmMxNDJkMjA3MGJiNzI2OTM4NDM%3D--484b22d11c45137c05ebb2d15f51c483995017ed;
91
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:41 GMT; HttpOnly
92
+ Status:
93
+ - 200 OK
94
+ X-Runtime:
95
+ - '0.018668'
96
+ X-Ua-Compatible:
97
+ - IE=Edge,chrome=1
98
+ Content-Length:
99
+ - '2'
100
+ Connection:
101
+ - keep-alive
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ! '{}'
105
+ http_version:
106
+ recorded_at: Thu, 20 Sep 2012 04:31:41 GMT
107
+ - request:
108
+ method: get
109
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Post?where=%7B%22title%22:%22hello1234567890abc!%22,%22objectId%22:%22HJtVz2Facc%22%7D
110
+ body:
111
+ encoding: US-ASCII
112
+ string: ''
113
+ headers:
114
+ Accept:
115
+ - ! '*/*; q=0.5, application/xml'
116
+ Accept-Encoding:
117
+ - gzip, deflate
118
+ User-Agent:
119
+ - Ruby
120
+ response:
121
+ status:
122
+ code: 200
123
+ message: OK
124
+ headers:
125
+ Access-Control-Allow-Origin:
126
+ - https://parse.com, https://www.parse.com
127
+ Access-Control-Request-Method:
128
+ - ! '*'
129
+ Cache-Control:
130
+ - max-age=0, private, must-revalidate
131
+ Content-Type:
132
+ - application/json; charset=utf-8
133
+ Date:
134
+ - Thu, 20 Sep 2012 04:31:42 GMT
135
+ Etag:
136
+ - ! '"e2412c1ffbfb6b53a82a9daf665b2c1a"'
137
+ Server:
138
+ - nginx/1.2.2
139
+ Set-Cookie:
140
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlNzIxOGU4NDc3YTQ4MGM5YWEzMmRmMjk0YTkxOWFiNTc%3D--c69d986c653d866281f07ff7a4b2dd10945ef00a;
141
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:42 GMT; HttpOnly
142
+ Status:
143
+ - 200 OK
144
+ X-Runtime:
145
+ - '0.278392'
146
+ X-Ua-Compatible:
147
+ - IE=Edge,chrome=1
148
+ Content-Length:
149
+ - '14'
150
+ Connection:
151
+ - keep-alive
152
+ body:
153
+ encoding: US-ASCII
154
+ string: ! '{"results":[]}'
155
+ http_version:
156
+ recorded_at: Thu, 20 Sep 2012 04:31:42 GMT
157
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,207 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Knife
6
+ body:
7
+ encoding: UTF-8
8
+ string: ! '{"is_shiny":"arbitrary"}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*; q=0.5, application/xml'
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '24'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 201
23
+ message: Created
24
+ headers:
25
+ Access-Control-Allow-Origin:
26
+ - https://parse.com, https://www.parse.com
27
+ Access-Control-Request-Method:
28
+ - ! '*'
29
+ Cache-Control:
30
+ - no-cache
31
+ Content-Type:
32
+ - application/json; charset=utf-8
33
+ Date:
34
+ - Thu, 20 Sep 2012 04:31:42 GMT
35
+ Location:
36
+ - https://api.parse.com/1/classes/Knife/WDFVFDfcEC
37
+ Server:
38
+ - nginx/1.2.2
39
+ Set-Cookie:
40
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlNmMyYTk3YjE1MTZjNDA4Yzc4ODA4YzFiODRhMjRmNWI%3D--3b621bd342d440e0601a1de74e7ae0e69f9d0199;
41
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:42 GMT; HttpOnly
42
+ Status:
43
+ - 201 Created
44
+ X-Runtime:
45
+ - '0.019350'
46
+ X-Ua-Compatible:
47
+ - IE=Edge,chrome=1
48
+ Content-Length:
49
+ - '64'
50
+ Connection:
51
+ - keep-alive
52
+ body:
53
+ encoding: US-ASCII
54
+ string: ! '{"createdAt":"2012-09-20T04:31:42.391Z","objectId":"WDFVFDfcEC"}'
55
+ http_version:
56
+ recorded_at: Thu, 20 Sep 2012 04:31:42 GMT
57
+ - request:
58
+ method: get
59
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Knife?where=%7B%7D
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ''
63
+ headers:
64
+ Accept:
65
+ - ! '*/*; q=0.5, application/xml'
66
+ Accept-Encoding:
67
+ - gzip, deflate
68
+ User-Agent:
69
+ - Ruby
70
+ response:
71
+ status:
72
+ code: 200
73
+ message: OK
74
+ headers:
75
+ Access-Control-Allow-Origin:
76
+ - https://parse.com, https://www.parse.com
77
+ Access-Control-Request-Method:
78
+ - ! '*'
79
+ Cache-Control:
80
+ - max-age=0, private, must-revalidate
81
+ Content-Type:
82
+ - application/json; charset=utf-8
83
+ Date:
84
+ - Thu, 20 Sep 2012 04:31:42 GMT
85
+ Etag:
86
+ - ! '"92c0f92b7c224a4c38d7d2597fd6432d"'
87
+ Server:
88
+ - nginx/1.2.2
89
+ Set-Cookie:
90
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlMGUwOGU1YTk0MWYyNGY1ZDUxZTM4MTkxYmE0ODFmY2Y%3D--abc4feeeb7fd8501c2aab6709370c42046d6f367;
91
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:42 GMT; HttpOnly
92
+ Status:
93
+ - 200 OK
94
+ X-Runtime:
95
+ - '0.019219'
96
+ X-Ua-Compatible:
97
+ - IE=Edge,chrome=1
98
+ Content-Length:
99
+ - '140'
100
+ Connection:
101
+ - keep-alive
102
+ body:
103
+ encoding: US-ASCII
104
+ string: ! '{"results":[{"is_shiny":"arbitrary","createdAt":"2012-09-20T04:31:42.391Z","updatedAt":"2012-09-20T04:31:42.391Z","objectId":"WDFVFDfcEC"}]}'
105
+ http_version:
106
+ recorded_at: Thu, 20 Sep 2012 04:31:42 GMT
107
+ - request:
108
+ method: delete
109
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Knife/WDFVFDfcEC
110
+ body:
111
+ encoding: US-ASCII
112
+ string: ''
113
+ headers:
114
+ Accept:
115
+ - ! '*/*; q=0.5, application/xml'
116
+ Accept-Encoding:
117
+ - gzip, deflate
118
+ User-Agent:
119
+ - Ruby
120
+ response:
121
+ status:
122
+ code: 200
123
+ message: OK
124
+ headers:
125
+ Access-Control-Allow-Origin:
126
+ - https://parse.com, https://www.parse.com
127
+ Access-Control-Request-Method:
128
+ - ! '*'
129
+ Cache-Control:
130
+ - max-age=0, private, must-revalidate
131
+ Content-Type:
132
+ - application/json; charset=utf-8
133
+ Date:
134
+ - Thu, 20 Sep 2012 04:31:42 GMT
135
+ Etag:
136
+ - ! '"99914b932bd37a50b983c5e7c90ae93b"'
137
+ Server:
138
+ - nginx/1.2.2
139
+ Set-Cookie:
140
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlNjkyZDM5NTk0OTJhMTljOTU1M2VlMTFhOGFlMzdmOWY%3D--4f423e78f0b76f05b64449a0d2e703cfe84a9ab8;
141
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:42 GMT; HttpOnly
142
+ Status:
143
+ - 200 OK
144
+ X-Runtime:
145
+ - '0.027036'
146
+ X-Ua-Compatible:
147
+ - IE=Edge,chrome=1
148
+ Content-Length:
149
+ - '2'
150
+ Connection:
151
+ - keep-alive
152
+ body:
153
+ encoding: US-ASCII
154
+ string: ! '{}'
155
+ http_version:
156
+ recorded_at: Thu, 20 Sep 2012 04:31:42 GMT
157
+ - request:
158
+ method: get
159
+ uri: https://FKEzdzDgEyghLDFgIVHYJehVlWpfVtUmEv4MUEkJ:bOYO7usWbrcIbL5L5bPzlYrSonQRvwJecC1XLsuN@api.parse.com/1/classes/Knife?count=1&where=%7B%7D
160
+ body:
161
+ encoding: US-ASCII
162
+ string: ''
163
+ headers:
164
+ Accept:
165
+ - ! '*/*; q=0.5, application/xml'
166
+ Accept-Encoding:
167
+ - gzip, deflate
168
+ User-Agent:
169
+ - Ruby
170
+ response:
171
+ status:
172
+ code: 200
173
+ message: OK
174
+ headers:
175
+ Access-Control-Allow-Origin:
176
+ - https://parse.com, https://www.parse.com
177
+ Access-Control-Request-Method:
178
+ - ! '*'
179
+ Cache-Control:
180
+ - max-age=0, private, must-revalidate
181
+ Content-Type:
182
+ - application/json; charset=utf-8
183
+ Date:
184
+ - Thu, 20 Sep 2012 04:31:42 GMT
185
+ Etag:
186
+ - ! '"8c97ea0119fb2eb809f32e913cb37202"'
187
+ Server:
188
+ - nginx/1.2.2
189
+ Set-Cookie:
190
+ - _parse_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiIlNDdlYzNmNzhiOTkyMjI3YzU1ZDVlZjViOTAzMTljNDY%3D--c7223fb9954b56c5f18775b25b095ebf49a590b5;
191
+ domain=.parse.com; path=/; expires=Tue, 20-Sep-2022 04:31:42 GMT; HttpOnly
192
+ Status:
193
+ - 200 OK
194
+ X-Runtime:
195
+ - '0.021084'
196
+ X-Ua-Compatible:
197
+ - IE=Edge,chrome=1
198
+ Content-Length:
199
+ - '24'
200
+ Connection:
201
+ - keep-alive
202
+ body:
203
+ encoding: US-ASCII
204
+ string: ! '{"results":[],"count":0}'
205
+ http_version:
206
+ recorded_at: Thu, 20 Sep 2012 04:31:43 GMT
207
+ recorded_with: VCR 2.2.4