rhoconnect 3.3.4 → 3.3.5
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.
- data/CHANGELOG.md +25 -20
- data/Gemfile.lock +12 -10
- data/bench/scripts/helpers.rb +2 -2
- data/doc/web-console.txt +7 -3
- data/installer/unix-like/rho_connect_install_constants.rb +1 -1
- data/lib/rhoconnect/jobs/ping_job.rb +11 -1
- data/lib/rhoconnect/ping/android.rb +2 -2
- data/lib/rhoconnect/version.rb +1 -1
- data/spec/api/user/ping_spec.rb +3 -0
- data/spec/jobs/ping_job_spec.rb +9 -0
- data/spec/ping/android_spec.rb +5 -5
- metadata +475 -475
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
## 3.3.5 (2012-09-20)
|
|
2
|
+
* merge changes from master to fix broken bench script helper
|
|
3
|
+
* ZD-2866 - Issue with Apple Push when User has windows device as one of targeted devices 2 target devices
|
|
4
|
+
* SPR 22764 - Add enqueue method to PingJob and fix specs
|
|
5
|
+
|
|
1
6
|
## 3.3.4 (2012-08-28)
|
|
2
|
-
* flush_zdata was not properly cleaning the related Redis storage (which led to incorrect CUD queue states)
|
|
7
|
+
* flush_zdata was not properly cleaning the related Redis storage (which led to incorrect CUD queue states)
|
|
3
8
|
|
|
4
9
|
## 3.3.3 (2012-08-21)
|
|
5
10
|
* allow selective bulk_sync source parameter to be sent as a comma-separated string
|
|
@@ -75,7 +80,7 @@
|
|
|
75
80
|
* #28094895 - Zendesk ticket #2354: Bulk sync not updating sources table (fields 'last_inserted_size' and 'backend_refresh_time' now updated)
|
|
76
81
|
* #28855323 - Bulk Sync Associations from Zendesk ticket #2377
|
|
77
82
|
* #28576723 - dpkg lock error on Ubuntu install
|
|
78
|
-
* #28094895 - Zendesk ticket #2354: Bulk sync not updating sources table (fields 'last_inserted_size' and 'backend_refresh_time' now updated)
|
|
83
|
+
* #28094895 - Zendesk ticket #2354: Bulk sync not updating sources table (fields 'last_inserted_size' and 'backend_refresh_time' now updated)
|
|
79
84
|
* #28865579 - Async dependencies are not properly initialized on Windows (need to add :mingw_19 to the list of platforms in Gemfile)
|
|
80
85
|
* Rhoconnect production stack updated to latest stable version of ruby, redis, and nginx: ruby-1.9.3-p194, redis-2.4.12, nginx-1.2.0.
|
|
81
86
|
|
|
@@ -84,7 +89,7 @@
|
|
|
84
89
|
* Async framework is introduced for rubies 1.9.x (no 1.8.7 or JRuby support)
|
|
85
90
|
* 26384435 - Rhoconnect Linux installer should use ruby-1.9.3-p125 as a default ruby
|
|
86
91
|
* 27612327 - Bulk Sync Not Returning Errors from Zendesk ticket #2336
|
|
87
|
-
* Rhoconnect production stack is updated for full support of async framework (nginx as reverse proxy server, thin app server)
|
|
92
|
+
* Rhoconnect production stack is updated for full support of async framework (nginx as reverse proxy server, thin app server)
|
|
88
93
|
* #28219647 - Schema Change Error from Zendesk ticket #2353
|
|
89
94
|
* #28328057 - Feature Request: Adding a Bulk Data Job after_perform hook from Zendesk ticket #2367
|
|
90
95
|
* #28330213 - Implementing fast_insert/update/delete API
|
|
@@ -93,7 +98,7 @@
|
|
|
93
98
|
## 3.1.2 (2012-04-02)
|
|
94
99
|
* #19297819 - Refactor server middleware loading to be static
|
|
95
100
|
* #25292219 - Ensure that Store.get_zdata always returns valid array (even if it is empty)
|
|
96
|
-
* #26310661 - No test_search
|
|
101
|
+
* #26310661 - No test_search
|
|
97
102
|
* #26868157 - bug in install.sh in rhoconnect installer
|
|
98
103
|
* #26384435 - Replace in rhoconnect installer Ruby Enterprise by latest stable Ruby 1.9.3
|
|
99
104
|
* #27184633 - Fixing error with recursive loading of application.rb in ruby-1.8.7 and ree
|
|
@@ -159,11 +164,11 @@
|
|
|
159
164
|
|
|
160
165
|
## 3.0.0 (2011-09-30)
|
|
161
166
|
* #18888077 - implement Redis transactions optimization for push_objects and push_deletes
|
|
162
|
-
* added 2 rake tasks (build:rpm and build:deb) to generate packaged software for popular linux servers
|
|
163
|
-
(CentOS/Ubuntu). The package includes ruby enterprise, redis and nginx servers, passenger,
|
|
164
|
-
and rhoconnect gem with all dependencies
|
|
167
|
+
* added 2 rake tasks (build:rpm and build:deb) to generate packaged software for popular linux servers
|
|
168
|
+
(CentOS/Ubuntu). The package includes ruby enterprise, redis and nginx servers, passenger,
|
|
169
|
+
and rhoconnect gem with all dependencies
|
|
165
170
|
* #19116273 - created new redis:startbg task for Rhostudio
|
|
166
|
-
|
|
171
|
+
|
|
167
172
|
## 3.0.0.rc1 (2011-09-27)
|
|
168
173
|
* load sqlite3 gem on demand, fixes issue with generator requiring it
|
|
169
174
|
* #18934311 - create :startbg task for Rhostudio
|
|
@@ -185,27 +190,27 @@
|
|
|
185
190
|
* #4397476 wrapped login/logoff around cud spec helpers
|
|
186
191
|
* backtrace logging in source adapter method exceptions
|
|
187
192
|
* returning string in authenticate instead of true sets the current user login name (Useful for OAuth2)
|
|
188
|
-
* #11904353 - fixed broken 'rake console' task, added new 'rhosync' namespace: 'rake rhosync:console'
|
|
193
|
+
* #11904353 - fixed broken 'rake console' task, added new 'rhosync' namespace: 'rake rhosync:console'
|
|
189
194
|
* #12105115 - removed unnecessary log4r dependency
|
|
190
|
-
* added bundler to manage gem's dependencies, migrated from rspec1 to rspec2
|
|
191
|
-
* #5687948 - fixed issue "iPhone push specs failed"
|
|
192
|
-
* use redis 2.2.14 by default
|
|
193
|
-
* added SystemTimer gem dependency (used only on posix systems)
|
|
195
|
+
* added bundler to manage gem's dependencies, migrated from rspec1 to rspec2
|
|
196
|
+
* #5687948 - fixed issue "iPhone push specs failed"
|
|
197
|
+
* use redis 2.2.14 by default
|
|
198
|
+
* added SystemTimer gem dependency (used only on posix systems)
|
|
194
199
|
* #13616807 - Rake task spec:all fails for enterprise ruby (ree)
|
|
195
200
|
* #13776713 - Rake -v 0.9.0 breaks rhosync rake tasks
|
|
196
|
-
* #14514773 - REST API push_object, push_deletes :md_size count fix
|
|
201
|
+
* #14514773 - REST API push_object, push_deletes :md_size count fix
|
|
197
202
|
* #5687948 - fixed issue "iPhone push specs failed"
|
|
198
203
|
* #12854737 - string vs. symbol problem in ruby 1.9 model.rb (contribute to ruby 1.9 support)
|
|
199
204
|
* #11692191 - ruby 1.9 support
|
|
200
205
|
* #2020980 - Test on JRuby. Code reworked to fully support JRuby platform.
|
|
201
|
-
* #14087743 - Merging the /login and /get_api_token methods.
|
|
202
|
-
* #14713569 - Moving all Server REST API calls into namespaces.
|
|
206
|
+
* #14087743 - Merging the /login and /get_api_token methods.
|
|
207
|
+
* #14713569 - Moving all Server REST API calls into namespaces.
|
|
203
208
|
* #14284841 - Merge ruby_19 branch into master
|
|
204
|
-
* #14784949 - Suppress rake -v 0.9.2 warning messages while running tasks.
|
|
209
|
+
* #14784949 - Suppress rake -v 0.9.2 warning messages while running tasks.
|
|
205
210
|
* #3174947 - RESTful routes for client management
|
|
206
211
|
* #14968209 - Generated Specs are failing on 2nd generated source
|
|
207
212
|
* #15270505 - sqlite3 is not listed as a dependency of rhosync gem (3.0.0)
|
|
208
|
-
* #15143911 - Schema Changed message from Zendesk ticket #1035 (merge from branch 2-1-stable 2.1.9)
|
|
213
|
+
* #15143911 - Schema Changed message from Zendesk ticket #1035 (merge from branch 2-1-stable 2.1.9)
|
|
209
214
|
* #14950665 - Benchmark application and libraries: rework REST calls to match new API restful routes.
|
|
210
215
|
* #14860303 - In bench tests x_domain_session_wrapper middleware not working under ruby 1.9.2.
|
|
211
216
|
* #15615327 - Rhoconnect migration
|
|
@@ -230,7 +235,7 @@
|
|
|
230
235
|
* #1018 - added functionality to delete user source data on user delete
|
|
231
236
|
* updated to rake 0.9.2
|
|
232
237
|
* #14911833 - Add support for rolling back updates on sync errors
|
|
233
|
-
|
|
238
|
+
|
|
234
239
|
## 2.1.7 (2011-05-31)
|
|
235
240
|
* #14021681 - check for client on client_sync class methods
|
|
236
241
|
* #14082861 - expose Store.lock timeout to high-level functions
|
|
@@ -252,7 +257,7 @@
|
|
|
252
257
|
* #13022667 - settings.yml doesn't work for setting external Redis instances
|
|
253
258
|
|
|
254
259
|
## 2.1.2 (2011-03-18)
|
|
255
|
-
* Use server-dir/redis.conf if not found at RedisRunner.prefix (via artemk)
|
|
260
|
+
* Use server-dir/redis.conf if not found at RedisRunner.prefix (via artemk)
|
|
256
261
|
* #8471337 - switch client user if it is not equal to current_user
|
|
257
262
|
* Upgrade rest-client dependency which includes cookie escape fix
|
|
258
263
|
* #10097347 - generate cryptographically secure secret key by default
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rhoconnect (3.3.
|
|
4
|
+
rhoconnect (3.3.5)
|
|
5
5
|
bundler (~> 1.0)
|
|
6
6
|
json (~> 1.6.0)
|
|
7
7
|
rake (~> 0.9.2.2)
|
|
@@ -28,7 +28,7 @@ GEM
|
|
|
28
28
|
mime-types
|
|
29
29
|
xml-simple
|
|
30
30
|
backports (2.6.2)
|
|
31
|
-
builder (3.
|
|
31
|
+
builder (3.1.3)
|
|
32
32
|
cabin (0.4.4)
|
|
33
33
|
json
|
|
34
34
|
childprocess (0.3.5)
|
|
@@ -41,14 +41,14 @@ GEM
|
|
|
41
41
|
crack (0.3.1)
|
|
42
42
|
daemons (1.1.9)
|
|
43
43
|
diff-lcs (1.1.3)
|
|
44
|
-
eventmachine (1.0.0
|
|
45
|
-
excon (0.16.
|
|
44
|
+
eventmachine (1.0.0)
|
|
45
|
+
excon (0.16.3)
|
|
46
46
|
execjs (1.4.0)
|
|
47
47
|
multi_json (~> 1.0)
|
|
48
48
|
extlib (0.9.15)
|
|
49
49
|
ffaker (1.14.0)
|
|
50
50
|
ffi (1.1.5)
|
|
51
|
-
fog (1.
|
|
51
|
+
fog (1.6.0)
|
|
52
52
|
builder
|
|
53
53
|
excon (~> 0.14)
|
|
54
54
|
formatador (~> 0.2.0)
|
|
@@ -59,13 +59,13 @@ GEM
|
|
|
59
59
|
nokogiri (~> 1.5.0)
|
|
60
60
|
ruby-hmac
|
|
61
61
|
formatador (0.2.3)
|
|
62
|
-
fpm (0.4.
|
|
62
|
+
fpm (0.4.17)
|
|
63
63
|
arr-pm (~> 0.0.7)
|
|
64
64
|
backports (= 2.6.2)
|
|
65
65
|
cabin (~> 0.4.3)
|
|
66
66
|
clamp (= 0.3.1)
|
|
67
67
|
json (= 1.6.6)
|
|
68
|
-
highline (1.6.
|
|
68
|
+
highline (1.6.15)
|
|
69
69
|
hike (1.2.1)
|
|
70
70
|
jasmine (1.2.1)
|
|
71
71
|
jasmine-core (>= 1.2.0)
|
|
@@ -79,6 +79,7 @@ GEM
|
|
|
79
79
|
multi_json
|
|
80
80
|
rainbow
|
|
81
81
|
sprockets (~> 2)
|
|
82
|
+
jruby-pageant (1.1.1)
|
|
82
83
|
json (1.6.6)
|
|
83
84
|
libwebsocket (0.1.5)
|
|
84
85
|
addressable
|
|
@@ -86,7 +87,8 @@ GEM
|
|
|
86
87
|
multi_json (1.3.6)
|
|
87
88
|
net-scp (1.0.4)
|
|
88
89
|
net-ssh (>= 1.99.1)
|
|
89
|
-
net-ssh (2.
|
|
90
|
+
net-ssh (2.6.0)
|
|
91
|
+
jruby-pageant (>= 1.1.1)
|
|
90
92
|
nokogiri (1.5.5)
|
|
91
93
|
rack (1.4.1)
|
|
92
94
|
rack-fiber_pool (0.9.2)
|
|
@@ -130,7 +132,7 @@ GEM
|
|
|
130
132
|
rack (~> 1.3, >= 1.3.6)
|
|
131
133
|
rack-protection (~> 1.2)
|
|
132
134
|
tilt (~> 1.3, >= 1.3.3)
|
|
133
|
-
sprockets (2.
|
|
135
|
+
sprockets (2.6.0)
|
|
134
136
|
hike (~> 1.2)
|
|
135
137
|
multi_json (~> 1.0)
|
|
136
138
|
rack (~> 1.0)
|
|
@@ -149,7 +151,7 @@ GEM
|
|
|
149
151
|
uuidtools (2.1.3)
|
|
150
152
|
vegas (0.1.11)
|
|
151
153
|
rack (>= 1.0.0)
|
|
152
|
-
webmock (1.8.
|
|
154
|
+
webmock (1.8.10)
|
|
153
155
|
addressable (>= 2.2.7)
|
|
154
156
|
crack (>= 0.1.7)
|
|
155
157
|
xml-simple (1.1.1)
|
data/bench/scripts/helpers.rb
CHANGED
|
@@ -72,7 +72,7 @@ module BenchHelpers
|
|
|
72
72
|
end
|
|
73
73
|
sleep rand(timeout)
|
|
74
74
|
token = JSON.parse(session.last_result.body)[1]['token']
|
|
75
|
-
progress_count = JSON.parse(session.last_result.body)[
|
|
75
|
+
progress_count = JSON.parse(session.last_result.body)[4]['total_count']
|
|
76
76
|
return progress_count if token == ''
|
|
77
77
|
|
|
78
78
|
verify_count(session,caller+"\n"+current_line)
|
|
@@ -92,7 +92,7 @@ module BenchHelpers
|
|
|
92
92
|
verify_links(session,create_objs,caller+"\n"+current_line) if create_objs
|
|
93
93
|
|
|
94
94
|
token = JSON.parse(session.last_result.body)[1]['token']
|
|
95
|
-
progress_count = JSON.parse(session.last_result.body)[
|
|
95
|
+
progress_count = JSON.parse(session.last_result.body)[4]['total_count']
|
|
96
96
|
end
|
|
97
97
|
progress_count
|
|
98
98
|
end
|
data/doc/web-console.txt
CHANGED
|
@@ -4,7 +4,7 @@ Web Console
|
|
|
4
4
|
Your RhoConnect application exposes a web interface which runs on http://localhost:9292/console/ (port 80 on Windows) by default. You can open the console by running the following in your application directory:
|
|
5
5
|
|
|
6
6
|
:::term
|
|
7
|
-
|
|
7
|
+
$ rhoconnect web
|
|
8
8
|
|
|
9
9
|
To login to the console:
|
|
10
10
|
|
|
@@ -13,12 +13,16 @@ To login to the console:
|
|
|
13
13
|
3. Default username is 'rhoadmin' and the password is empty
|
|
14
14
|
4. Now you will be presented with a page showing your current license, for example:
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
Licensed to Rhomobile on Fri Apr 23 17:20:13 -0700 2010,
|
|
16
|
+
|
|
17
|
+
Licensed to Rhomobile on Fri Apr 23 17:20:13 -0700 2010,
|
|
18
18
|
available 9 of 10 devices
|
|
19
19
|
|
|
20
20
|
It will also show a link to "Application Users" where you can view users of the system as well as devices they have registered.
|
|
21
21
|
|
|
22
|
+
To reset the server, you can click on the "Reset" button at the bottom.
|
|
23
|
+
|
|
24
|
+
**NOTE: Resetting the server will remove all data from redis including registered devices, this cannot be undone.**
|
|
25
|
+
|
|
22
26
|
If you want to disable this web interface, you can do so by editing the rackup file, config.ru:
|
|
23
27
|
|
|
24
28
|
:::ruby
|
|
@@ -21,7 +21,7 @@ module Constants
|
|
|
21
21
|
NGINX_URL = "http://nginx.org/download/#{NGINX}.tar.gz"
|
|
22
22
|
EVENTMACHINE_URL = "https://github.com/rhomobile/eventmachine/tarball/master"
|
|
23
23
|
URLS = [ REDIS_URL, SQLITE3_URL, NGINX_URL]
|
|
24
|
-
GEMS = ["bundler"
|
|
24
|
+
GEMS = ["bundler"] # foreman"
|
|
25
25
|
|
|
26
26
|
SUPPORTED_PKG_MGRS = ["apt-get", "yum"]
|
|
27
27
|
SUPPORTED_WEB_SERVERS = ["apache2", "nginx"]
|
|
@@ -3,6 +3,11 @@ require 'rhoconnect/ping'
|
|
|
3
3
|
module Rhoconnect
|
|
4
4
|
module PingJob
|
|
5
5
|
@queue = :ping
|
|
6
|
+
|
|
7
|
+
# Enqueue a ping job
|
|
8
|
+
def self.enqueue(params)
|
|
9
|
+
Resque.enqueue(PingJob, params)
|
|
10
|
+
end
|
|
6
11
|
|
|
7
12
|
# Perform a ping for all clients registered to a user
|
|
8
13
|
def self.perform(params)
|
|
@@ -52,7 +57,12 @@ module Rhoconnect
|
|
|
52
57
|
end
|
|
53
58
|
if send_push
|
|
54
59
|
type = client.device_push_type || client.device_type
|
|
55
|
-
klass =
|
|
60
|
+
klass = nil
|
|
61
|
+
begin
|
|
62
|
+
klass = Object.const_get(camelize(type.downcase))
|
|
63
|
+
rescue Exception => e
|
|
64
|
+
log "Dropping ping request for unsupported platform '#{type}'"
|
|
65
|
+
end
|
|
56
66
|
if klass
|
|
57
67
|
params['vibrate'] = params['vibrate'].to_s
|
|
58
68
|
begin
|
|
@@ -50,8 +50,8 @@ module Rhoconnect
|
|
|
50
50
|
raise AndroidPingError.new("Android ping error: #{$1 || ''}")
|
|
51
51
|
else
|
|
52
52
|
# store new token in redis for future calls
|
|
53
|
-
if response[:update_client_auth]
|
|
54
|
-
Store.put_value(C2DM_AUTHTOKEN_KEY, response[:update_client_auth])
|
|
53
|
+
if response.headers[:update_client_auth]
|
|
54
|
+
Store.put_value(C2DM_AUTHTOKEN_KEY, response.headers[:update_client_auth])
|
|
55
55
|
end
|
|
56
56
|
response.return!(request, result, &block)
|
|
57
57
|
end
|
data/lib/rhoconnect/version.rb
CHANGED
data/spec/api/user/ping_spec.rb
CHANGED
|
@@ -5,6 +5,7 @@ describe "RhoconnectApiPing" do
|
|
|
5
5
|
it "should do ping synchronously" do
|
|
6
6
|
params = {"user_id" => @u.id, "sources" => [@s.name], "message" => 'hello world',
|
|
7
7
|
"vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3'}
|
|
8
|
+
PingJob.should respond_to :perform
|
|
8
9
|
PingJob.should_receive(:perform).once.with(params)
|
|
9
10
|
post "/rc/#{Rhoconnect::API_VERSION}/users/ping", params, {Rhoconnect::API_TOKEN_HEADER => @api_token}
|
|
10
11
|
last_response.should be_ok
|
|
@@ -13,6 +14,8 @@ describe "RhoconnectApiPing" do
|
|
|
13
14
|
it "should do ping asynchronously" do
|
|
14
15
|
params = {"user_id" => @u.id, "async" => "true","sources" => [@s.name], "message" => 'hello world',
|
|
15
16
|
"vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3'}
|
|
17
|
+
|
|
18
|
+
PingJob.should respond_to :enqueue
|
|
16
19
|
PingJob.should_receive(:enqueue).once.with(params)
|
|
17
20
|
post "/rc/#{Rhoconnect::API_VERSION}/users/ping", params, {Rhoconnect::API_TOKEN_HEADER => @api_token}
|
|
18
21
|
last_response.should be_ok
|
data/spec/jobs/ping_job_spec.rb
CHANGED
|
@@ -63,6 +63,15 @@ describe "PingJob" do
|
|
|
63
63
|
'device_port' => @c.device_port}.merge!(params))
|
|
64
64
|
PingJob.perform(params)
|
|
65
65
|
end
|
|
66
|
+
|
|
67
|
+
it "should skip ping for the unknown platform" do
|
|
68
|
+
params = {"user_id" => @u.id, "api_token" => @api_token,
|
|
69
|
+
"sources" => [@s.name], "message" => 'hello world',
|
|
70
|
+
"vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3',"phone_id"=>nil}
|
|
71
|
+
@c.device_type = 'unknown_device_type'
|
|
72
|
+
PingJob.should_receive(:log).once.with("Dropping ping request for unsupported platform '#{@c.device_type}'")
|
|
73
|
+
PingJob.perform(params)
|
|
74
|
+
end
|
|
66
75
|
|
|
67
76
|
it "should skip ping for empty device_type" do
|
|
68
77
|
params = {"user_id" => @u.id, "api_token" => @api_token,
|
data/spec/ping/android_spec.rb
CHANGED
|
@@ -15,7 +15,7 @@ describe "Ping Android" do
|
|
|
15
15
|
result = 'id=0:34234234134254%abc123\n'
|
|
16
16
|
@response.stub!(:code).and_return(200)
|
|
17
17
|
@response.stub!(:body).and_return(result)
|
|
18
|
-
@response.stub!(:
|
|
18
|
+
@response.stub!(:headers).and_return({})
|
|
19
19
|
@response.stub!(:return!).and_return(@response)
|
|
20
20
|
setup_post_yield(@response)
|
|
21
21
|
Android.ping(@params).body.should == result
|
|
@@ -34,7 +34,7 @@ describe "Ping Android" do
|
|
|
34
34
|
error = 'Error=QuotaExceeded'
|
|
35
35
|
@response.stub!(:code).and_return(200)
|
|
36
36
|
@response.stub!(:body).and_return(error)
|
|
37
|
-
@response.stub!(:
|
|
37
|
+
@response.stub!(:headers).and_return(nil)
|
|
38
38
|
setup_post_yield(@response)
|
|
39
39
|
Android.should_receive(:log).twice
|
|
40
40
|
lambda { Android.ping(@params) }.should raise_error(Android::AndroidPingError, "Android ping error: QuotaExceeded")
|
|
@@ -44,7 +44,7 @@ describe "Ping Android" do
|
|
|
44
44
|
error = 'Error=BadAuthentication'
|
|
45
45
|
@response.stub!(:code).and_return(403)
|
|
46
46
|
@response.stub!(:body).and_return(error)
|
|
47
|
-
@response.stub!(:
|
|
47
|
+
@response.stub!(:headers).and_return({})
|
|
48
48
|
setup_post_yield(@response)
|
|
49
49
|
Android.should_receive(:log).twice
|
|
50
50
|
lambda { Android.ping(@params) }.should raise_error(Android::InvalidAuthToken, "Can not obtain auth token from C2DM service. Make sure that your C2DM credentials are valid.: Error=BadAuthentication")
|
|
@@ -54,7 +54,7 @@ describe "Ping Android" do
|
|
|
54
54
|
result = "SID=somesid\nAuth=myauthtoken\n"
|
|
55
55
|
@response.stub!(:code).and_return(200)
|
|
56
56
|
@response.stub!(:body).and_return(result)
|
|
57
|
-
@response.stub!(:
|
|
57
|
+
@response.stub!(:headers).and_return({})
|
|
58
58
|
setup_post_yield(@response)
|
|
59
59
|
|
|
60
60
|
Android.get_c2dm_token
|
|
@@ -79,7 +79,7 @@ describe "Ping Android" do
|
|
|
79
79
|
Store.put_value(Android::C2DM_AUTHTOKEN_KEY, 'ValidAuthToken')
|
|
80
80
|
@response.stub!(:code).and_return(200)
|
|
81
81
|
@response.stub!(:body).and_return('')
|
|
82
|
-
@response.stub!(:
|
|
82
|
+
@response.stub!(:headers).and_return(:update_client_auth => 'abc123')
|
|
83
83
|
@response.stub!(:return!).and_return(@response)
|
|
84
84
|
setup_post_yield(@response)
|
|
85
85
|
Android.ping(@params)
|