rhoconnect 4.0.4 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +5 -13
  2. data/CHANGELOG.md +54 -5
  3. data/CREDITS +219 -219
  4. data/Gemfile +2 -2
  5. data/Gemfile.lock +68 -79
  6. data/Rakefile +1 -2
  7. data/bench/benchapp/spec/models/ruby/mock_adapter_spec.rb +17 -17
  8. data/bench/benchapp/spec/models/ruby/queue_mock_adapter_spec.rb +17 -17
  9. data/bench/benchapp/spec/spec_helper.rb +3 -3
  10. data/bench/blobapp/spec/models/ruby/blob_adapter_spec.rb +17 -17
  11. data/bench/blobapp/spec/spec_helper.rb +3 -3
  12. data/bench/lib/bench/runner.rb +1 -69
  13. data/bench/lib/bench.rb +18 -18
  14. data/bench/spec/mock_adapter_spec.rb +54 -55
  15. data/bench/spec/mock_client_spec.rb +47 -48
  16. data/bench/spec/result_spec.rb +41 -44
  17. data/bench/spec/utils_spec.rb +24 -25
  18. data/commands/generators/app.rb +7 -5
  19. data/commands/generators/controller.rb +7 -5
  20. data/commands/generators/model.rb +7 -5
  21. data/commands/generators/source.rb +7 -5
  22. data/commands/parser.rb +1 -1
  23. data/commands/redis/redis_download.rb +1 -1
  24. data/doc/async-jobs.txt +9 -9
  25. data/doc/supported-platforms.txt +0 -2
  26. data/generators/rhoconnect.rb +92 -212
  27. data/generators/templates/application/rcgemfile +3 -3
  28. data/generators/templates/application/spec/application_controller_spec.rb +14 -16
  29. data/generators/templates/application/spec/js_spec.rb +20 -20
  30. data/generators/templates/application/spec/spec_helper.rb +1 -1
  31. data/generators/templates/source/controllers/ruby/controller_spec.rb +18 -19
  32. data/generators/templates/source/models/ruby/model_spec.rb +17 -17
  33. data/install.sh +10 -21
  34. data/installer/unix-like/rho_connect_install_constants.rb +5 -5
  35. data/installer/unix-like/rho_connect_install_installers.rb +4 -4
  36. data/installer/utils/constants.rb +6 -6
  37. data/installer/utils/nix_install_test.rb +29 -29
  38. data/installer/utils/package_upload/repos.rake +16 -26
  39. data/js-adapters/node.rb +4 -4
  40. data/js-adapters/node_channel.rb +4 -8
  41. data/lib/rhoconnect/db_adapter.rb +13 -13
  42. data/lib/rhoconnect/handler/changes/engine.rb +1 -1
  43. data/lib/rhoconnect/jobs/bulk_data_job.rb +29 -29
  44. data/lib/rhoconnect/license.rb +7 -7
  45. data/lib/rhoconnect/model/helpers/find_duplicates_on_update.rb +13 -13
  46. data/lib/rhoconnect/ping/apple.rb +4 -4
  47. data/lib/rhoconnect/server.rb +2 -2
  48. data/lib/rhoconnect/source.rb +2 -2
  49. data/lib/rhoconnect/store.rb +12 -6
  50. data/lib/rhoconnect/utilities.rb +2 -2
  51. data/lib/rhoconnect/version.rb +1 -1
  52. data/lib/rhoconnect.rb +6 -4
  53. data/rhoconnect.gemspec +5 -6
  54. data/spec/api/api_helper.rb +1 -1
  55. data/spec/api/app/fast_delete_spec.rb +22 -22
  56. data/spec/api/app/fast_insert_spec.rb +23 -23
  57. data/spec/api/app/fast_update_spec.rb +63 -63
  58. data/spec/api/app/push_deletes_spec.rb +11 -13
  59. data/spec/api/app/push_objects_spec.rb +39 -39
  60. data/spec/api/client/client_get_db_doc_spec.rb +29 -29
  61. data/spec/api/client/client_set_db_doc_spec.rb +11 -11
  62. data/spec/api/client/get_client_params_spec.rb +29 -29
  63. data/spec/api/client/list_client_docs_spec.rb +32 -34
  64. data/spec/api/client/reset_spec.rb +30 -30
  65. data/spec/api/readstate/set_refresh_time_spec.rb +43 -43
  66. data/spec/api/source/get_source_params_spec.rb +32 -34
  67. data/spec/api/source/list_sources_spec.rb +13 -13
  68. data/spec/api/source/update_source_params_spec.rb +19 -19
  69. data/spec/api/store/get_db_doc_spec.rb +27 -27
  70. data/spec/api/store/set_db_doc_spec.rb +38 -38
  71. data/spec/api/system/adapter_spec.rb +27 -29
  72. data/spec/api/system/get_license_info_spec.rb +11 -11
  73. data/spec/api/system/login_spec.rb +37 -37
  74. data/spec/api/system/reset_spec.rb +15 -15
  75. data/spec/api/system/stats_spec.rb +70 -71
  76. data/spec/api/user/create_user_spec.rb +37 -37
  77. data/spec/api/user/delete_client_spec.rb +7 -7
  78. data/spec/api/user/delete_user_spec.rb +62 -62
  79. data/spec/api/user/list_clients_spec.rb +24 -24
  80. data/spec/api/user/list_source_docs_spec.rb +29 -29
  81. data/spec/api/user/list_users_spec.rb +22 -22
  82. data/spec/api/user/ping_spec.rb +18 -18
  83. data/spec/api/user/show_user_spec.rb +10 -10
  84. data/spec/api/user/update_user_spec.rb +43 -43
  85. data/spec/api/user/user_get_db_doc_spec.rb +12 -12
  86. data/spec/api/user/user_set_db_doc_spec.rb +37 -37
  87. data/spec/api_token_spec.rb +8 -8
  88. data/spec/app_spec.rb +18 -17
  89. data/spec/apps/jstestapp/settings/settings.yml +2 -0
  90. data/spec/async_spec.rb +9 -11
  91. data/spec/bulk_data/bulk_data_spec.rb +120 -120
  92. data/spec/cli/cli_spec.rb +50 -53
  93. data/spec/client_spec.rb +105 -105
  94. data/spec/client_sync_spec.rb +529 -528
  95. data/spec/controllers/js_base_spec.rb +147 -141
  96. data/spec/doc/doc_spec.rb +51 -52
  97. data/spec/document_spec.rb +58 -58
  98. data/spec/dynamic_adapter_spec.rb +33 -36
  99. data/spec/generator/generator_spec.rb +76 -42
  100. data/spec/jobs/bulk_data_job_spec.rb +101 -102
  101. data/spec/jobs/ping_job_spec.rb +176 -177
  102. data/spec/jobs/source_job_spec.rb +24 -25
  103. data/spec/license_spec.rb +54 -55
  104. data/spec/models/js_base_spec.rb +121 -120
  105. data/spec/perf/bulk_data_perf_spec.rb +23 -24
  106. data/spec/perf/perf_spec_helper.rb +7 -7
  107. data/spec/perf/store_perf_spec.rb +139 -140
  108. data/spec/ping/apple_spec.rb +65 -65
  109. data/spec/ping/gcm_spec.rb +83 -84
  110. data/spec/ping/rhoconnect_push_spec.rb +52 -53
  111. data/spec/predefined_adapters/rho_internal_bench_adapter_controller_js_spec.rb +100 -101
  112. data/spec/predefined_adapters/rho_internal_js_bench_adapter_js_spec.rb +29 -31
  113. data/spec/read_state_spec.rb +24 -25
  114. data/spec/rhoconnect_spec.rb +7 -7
  115. data/spec/server/server_spec.rb +664 -662
  116. data/spec/server/stats_spec.rb +12 -12
  117. data/spec/source_adapter_spec.rb +124 -125
  118. data/spec/source_spec.rb +148 -149
  119. data/spec/source_sync_spec.rb +736 -736
  120. data/spec/spec_helper.rb +4 -5
  121. data/spec/stats/record_spec.rb +22 -21
  122. data/spec/store_orm_spec.rb +48 -48
  123. data/spec/store_spec.rb +428 -426
  124. data/spec/support/shared_examples.rb +5 -7
  125. data/spec/sync_states_spec.rb +67 -67
  126. data/spec/test_methods_spec.rb +121 -123
  127. data/spec/testdata/10000-data.txt +0 -0
  128. data/spec/testdata/5000-data.txt +0 -0
  129. data/spec/user_spec.rb +102 -102
  130. data/tasks/redis.rake +3 -3
  131. metadata +154 -195
  132. data/bench/benchapp/tmp/pids/passenger.9292.pid.lock +0 -0
  133. data/bench/benchapp/tmp/restart.txt +0 -0
  134. data/bench/blobapp/settings/license.key.bak +0 -2
  135. data/bench/blobapp/tmp/restart.txt +0 -0
  136. data/bench/lib/testdata/1-data.txt +0 -0
  137. data/bench/lib/testdata/10-data.txt +0 -0
  138. data/bench/lib/testdata/2-data.txt +0 -0
  139. data/bench/lib/testdata/250-data.txt +0 -0
  140. data/bench/lib/testdata/5-blob_data.txt +0 -0
  141. data/bench/lib/testdata/5-data.txt +0 -0
  142. data/bench/lib/testdata/50-data.txt +0 -0
  143. data/bench/lib/testdata/500-data.txt +0 -0
  144. data/doc/protocol.html +0 -1993
  145. data/spec/coverage/rcov/assets/0.2.3/jquery-1.3.2.min.js +0 -19
  146. data/spec/coverage/rcov/assets/0.2.3/jquery.tablesorter.min.js +0 -15
  147. data/spec/coverage/rcov/assets/0.2.3/print.css +0 -12
  148. data/spec/coverage/rcov/assets/0.2.3/rcov.js +0 -42
  149. data/spec/coverage/rcov/assets/0.2.3/screen.css +0 -270
  150. data/spec/coverage/rcov/index.html +0 -88
  151. data/spec/generator/generator_spec_helper.rb +0 -9
@@ -5,107 +5,106 @@ require File.join(File.dirname(__FILE__),'..','..','lib','rhoconnect','server.rb
5
5
  describe "Rhoconnect::RhoInternalJsBenchAdapterController" do
6
6
  include Rack::Test::Methods
7
7
  include Rhoconnect
8
+ include_examples "SharedRhoconnectHelper", :rhoconnect_data => true
8
9
 
9
- it_behaves_like "SharedRhoconnectHelper", :rhoconnect_data => true do
10
- def app
11
- @app ||= Rack::URLMap.new Rhoconnect.url_map
12
- end
13
-
14
- before(:each) do
15
- Rhoconnect::Server.set :environment, :test
16
- Rhoconnect::Server.set :secret, "secure!"
17
- Rhoconnect.use_node = true
18
- Rhoconnect.bootstrap(get_testapp_path)
19
- do_post "/rc/#{Rhoconnect::API_VERSION}/app/login", "login" => @u.login, "password" => 'testpass'
20
- end
21
-
22
- after(:each) do
23
- Rhoconnect::Store.flush_all
24
- Rhoconnect::Node.kill_process
25
- end
26
-
27
- it "should call query method" do
28
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
29
- last_response.should be_ok
30
- body = JSON.parse(last_response.body)
31
- end
32
-
33
- it "should call create method" do
34
- hsh = {'create'=>{'1'=>{'mockId'=>'1','name'=>'testname','price'=>'$199'}}}
35
- post '/app/v1/RhoInternalJsBenchAdapter', hsh,{Rhoconnect::CLIENT_ID_HEADER => @c.id}
36
- last_response.should be_ok
37
-
38
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
39
- body = JSON.parse(last_response.body)
40
- body[5]["insert"]["mockId"]["mockId"].should == "1"
41
- end
42
-
43
- it "should call update method" do
44
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
45
- body = JSON.parse(last_response.body)
46
- body[4]["total_count"].should == 0
47
-
48
- hsh = {'create'=>{'1'=>{'mockId'=>'1','name'=>'testname','price'=>'$199'}}}
49
- post '/app/v1/RhoInternalJsBenchAdapter', hsh,{Rhoconnect::CLIENT_ID_HEADER => @c.id}
50
- last_response.should be_ok
51
-
52
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
53
- body = JSON.parse(last_response.body)
54
- token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
55
- count = body[4]["total_count"]
56
- count.should == 1
57
-
58
- get '/app/v1/RhoInternalJsBenchAdapter', {:token=>token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
59
- body = JSON.parse(last_response.body)
60
- count = body[4]["total_count"]
61
- count.should == 1
62
-
63
- hsh = {'update'=>{'mockId'=>'1','name'=>'updatename'}}
64
- put '/app/v1/RhoInternalJsBenchAdapter/mockId',hsh, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
65
- last_response.should be_ok
66
-
67
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
68
- body = JSON.parse(last_response.body)
69
- puts "body is #{body}"
70
- token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
71
- #body[5]["insert"]["mockId"]["name"].should == "updatename"
72
-
73
- get '/app/v1/RhoInternalJsBenchAdapter', {:token=>token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
74
- body = JSON.parse(last_response.body)
75
- puts "body is #{body}"
76
- last_response.should be_ok
77
- end
78
-
79
- it "should call delete method" do
80
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
81
- body = JSON.parse(last_response.body)
82
- body[4]["total_count"].should == 0
83
-
84
- hsh = {'create'=>{'1'=>{'mockId'=>'1','name'=>'testname','price'=>'$199'}}}
85
- post '/app/v1/RhoInternalJsBenchAdapter', hsh,{Rhoconnect::CLIENT_ID_HEADER => @c.id}
86
- last_response.should be_ok
87
-
88
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
89
- body = JSON.parse(last_response.body)
90
- token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
91
- count = body[4]["total_count"]
92
- count.should == 1
93
-
94
- get '/app/v1/RhoInternalJsBenchAdapter', {:token => token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
95
- body = JSON.parse(last_response.body)
96
- count = body[4]["total_count"]
97
- count.should == 1
98
-
99
- delete '/app/v1/RhoInternalJsBenchAdapter/1',{}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
100
- last_response.should be_ok
101
-
102
- get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
103
- body = JSON.parse(last_response.body)
104
- token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
105
-
106
- get '/app/v1/RhoInternalJsBenchAdapter', {:token => token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
107
- body = JSON.parse(last_response.body)
108
- body[4]["total_count"].should == 0
109
- end
10
+ def app
11
+ @app ||= Rack::URLMap.new Rhoconnect.url_map
12
+ end
13
+
14
+ before(:each) do
15
+ Rhoconnect::Server.set :environment, :test
16
+ Rhoconnect::Server.set :secret, "secure!"
17
+ Rhoconnect.use_node = true
18
+ Rhoconnect.bootstrap(get_testapp_path)
19
+ do_post "/rc/#{Rhoconnect::API_VERSION}/app/login", "login" => @u.login, "password" => 'testpass'
20
+ end
21
+
22
+ after(:each) do
23
+ Rhoconnect::Store.flush_all
24
+ Rhoconnect::Node.kill_process
25
+ end
26
+
27
+ it "should call query method" do
28
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
29
+ last_response.should be_ok
30
+ body = JSON.parse(last_response.body)
31
+ end
32
+
33
+ it "should call create method" do
34
+ hsh = {'create'=>{'1'=>{'mockId'=>'1','name'=>'testname','price'=>'$199'}}}
35
+ post '/app/v1/RhoInternalJsBenchAdapter', hsh,{Rhoconnect::CLIENT_ID_HEADER => @c.id}
36
+ last_response.should be_ok
37
+
38
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
39
+ body = JSON.parse(last_response.body)
40
+ body[5]["insert"]["mockId"]["mockId"].should == "1"
41
+ end
42
+
43
+ it "should call update method" do
44
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
45
+ body = JSON.parse(last_response.body)
46
+ body[4]["total_count"].should == 0
47
+
48
+ hsh = {'create'=>{'1'=>{'mockId'=>'1','name'=>'testname','price'=>'$199'}}}
49
+ post '/app/v1/RhoInternalJsBenchAdapter', hsh,{Rhoconnect::CLIENT_ID_HEADER => @c.id}
50
+ last_response.should be_ok
51
+
52
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
53
+ body = JSON.parse(last_response.body)
54
+ token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
55
+ count = body[4]["total_count"]
56
+ count.should == 1
57
+
58
+ get '/app/v1/RhoInternalJsBenchAdapter', {:token=>token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
59
+ body = JSON.parse(last_response.body)
60
+ count = body[4]["total_count"]
61
+ count.should == 1
62
+
63
+ hsh = {'update'=>{'mockId'=>'1','name'=>'updatename'}}
64
+ put '/app/v1/RhoInternalJsBenchAdapter/mockId',hsh, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
65
+ last_response.should be_ok
66
+
67
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
68
+ body = JSON.parse(last_response.body)
69
+ puts "body is #{body}"
70
+ token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
71
+ #body[5]["insert"]["mockId"]["name"].should == "updatename"
72
+
73
+ get '/app/v1/RhoInternalJsBenchAdapter', {:token=>token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
74
+ body = JSON.parse(last_response.body)
75
+ puts "body is #{body}"
76
+ last_response.should be_ok
77
+ end
78
+
79
+ it "should call delete method" do
80
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
81
+ body = JSON.parse(last_response.body)
82
+ body[4]["total_count"].should == 0
83
+
84
+ hsh = {'create'=>{'1'=>{'mockId'=>'1','name'=>'testname','price'=>'$199'}}}
85
+ post '/app/v1/RhoInternalJsBenchAdapter', hsh,{Rhoconnect::CLIENT_ID_HEADER => @c.id}
86
+ last_response.should be_ok
87
+
88
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
89
+ body = JSON.parse(last_response.body)
90
+ token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
91
+ count = body[4]["total_count"]
92
+ count.should == 1
93
+
94
+ get '/app/v1/RhoInternalJsBenchAdapter', {:token => token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
95
+ body = JSON.parse(last_response.body)
96
+ count = body[4]["total_count"]
97
+ count.should == 1
98
+
99
+ delete '/app/v1/RhoInternalJsBenchAdapter/1',{}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
100
+ last_response.should be_ok
101
+
102
+ get '/app/v1/RhoInternalJsBenchAdapter', {}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
103
+ body = JSON.parse(last_response.body)
104
+ token = last_response.headers["X-Rhoconnect-PAGE-TOKEN"]
105
+
106
+ get '/app/v1/RhoInternalJsBenchAdapter', {:token => token}, {Rhoconnect::CLIENT_ID_HEADER => @c.id}
107
+ body = JSON.parse(last_response.body)
108
+ body[4]["total_count"].should == 0
110
109
  end
111
110
  end
@@ -3,42 +3,40 @@ require File.join(File.dirname(__FILE__),'..','..','lib','rhoconnect','server.rb
3
3
 
4
4
  describe "Rhoconnect::RhoInternalJsBenchAdapter" do
5
5
  include Rhoconnect
6
+ include_examples "SharedRhoconnectHelper", :rhoconnect_data => true
6
7
 
7
- it_behaves_like "SharedRhoconnectHelper", :rhoconnect_data => true do
8
- before(:each) do
9
- Rhoconnect::Server.set :environment, :test
10
- Rhoconnect::Server.set :secret, "secure!"
11
- Rhoconnect.use_node = true
12
- Rhoconnect.bootstrap(get_testapp_path)
13
- end
14
-
15
- def app
16
- @app ||= Rack::URLMap.new Rhoconnect.url_map
17
- end
8
+ before(:each) do
9
+ Rhoconnect::Server.set :environment, :test
10
+ Rhoconnect::Server.set :secret, "secure!"
11
+ Rhoconnect.use_node = true
12
+ Rhoconnect.bootstrap(get_testapp_path)
13
+ end
18
14
 
19
- after(:each) do
20
- Rhoconnect::Store.flush_all
21
- Rhoconnect::Node.kill_process
22
- #Source.valid_doctypes.delete('tmpdoc'.to_sym)
23
- end
15
+ def app
16
+ @app ||= Rack::URLMap.new Rhoconnect.url_map
17
+ end
24
18
 
25
- it "should call login method from model" do
26
- rho_int = RhoInternalJsBenchAdapter.new(Source.load('RhoInternalJsBenchAdapter', {:app_id => @a.id, :user_id => @u.id}))
27
- res = rho_int.login
28
- res.should == true
29
- end
19
+ after(:each) do
20
+ Rhoconnect::Store.flush_all
21
+ Rhoconnect::Node.kill_process
22
+ #Source.valid_doctypes.delete('tmpdoc'.to_sym)
23
+ end
30
24
 
31
- it "should call logoff method from model" do
32
- rho_int = RhoInternalJsBenchAdapter.new(Source.load('RhoInternalJsBenchAdapter', {:app_id => @a.id, :user_id => @u.id}))
33
- res = rho_int.logoff
34
- res.should == true
35
- end
25
+ it "should call login method from model" do
26
+ rho_int = RhoInternalJsBenchAdapter.new(Source.load('RhoInternalJsBenchAdapter', {:app_id => @a.id, :user_id => @u.id}))
27
+ res = rho_int.login
28
+ res.should == true
29
+ end
36
30
 
37
- it "should call query method from model" do
38
- rho_int = RhoInternalJsBenchAdapter.new(Source.load('RhoInternalJsBenchAdapter', {:app_id => @a.id, :user_id => @u.id}))
39
- res = rho_int.query
40
- res.should == true
41
- end
31
+ it "should call logoff method from model" do
32
+ rho_int = RhoInternalJsBenchAdapter.new(Source.load('RhoInternalJsBenchAdapter', {:app_id => @a.id, :user_id => @u.id}))
33
+ res = rho_int.logoff
34
+ res.should == true
35
+ end
42
36
 
37
+ it "should call query method from model" do
38
+ rho_int = RhoInternalJsBenchAdapter.new(Source.load('RhoInternalJsBenchAdapter', {:app_id => @a.id, :user_id => @u.id}))
39
+ res = rho_int.query
40
+ res.should == true
43
41
  end
44
42
  end
@@ -1,34 +1,33 @@
1
1
  require File.join(File.dirname(__FILE__),'spec_helper')
2
2
 
3
3
  describe "ReadState" do
4
- it_behaves_like "SharedRhoconnectHelper", :rhoconnect_data => false do
5
- it "should create refresh with correct id" do
6
- @r.id.should == "#{@a_fields[:name]}:#{@u_fields[:login]}:#{@s_fields[:name]}"
7
- end
4
+ include_examples "SharedRhoconnectHelper", :rhoconnect_data => false
8
5
 
9
- it "should create refresh with default fields" do
10
- @r.refresh_time.should <= Time.now.to_i
11
- end
6
+ it "should create refresh with correct id" do
7
+ @r.id.should == "#{@a_fields[:name]}:#{@u_fields[:login]}:#{@s_fields[:name]}"
8
+ end
9
+
10
+ it "should create refresh with default fields" do
11
+ @r.refresh_time.should <= Time.now.to_i
12
+ end
12
13
 
13
- it "should load refresh with params" do
14
- @r1 = ReadState.load(:app_id => @a_fields[:name],
15
- :user_id => @u_fields[:login],:source_name => @s_fields[:name])
16
- @r1.refresh_time.should <= Time.now.to_i
17
- end
14
+ it "should load refresh with params" do
15
+ @r1 = ReadState.load(:app_id => @a_fields[:name],
16
+ :user_id => @u_fields[:login],:source_name => @s_fields[:name])
17
+ @r1.refresh_time.should <= Time.now.to_i
18
+ end
19
+
20
+ it "should delete read_state from db" do
21
+ ReadState.delete(@a_fields[:name])
22
+ Store.keys("read_state*").should == []
23
+ end
18
24
 
19
- it "should delete read_state from db" do
20
- ReadState.delete(@a_fields[:name])
21
- Store.keys("read_state*").should == []
22
- end
23
-
24
- it "should delete read_state from source" do
25
- time = Time.now.to_i
26
- @s.read_state.refresh_time = time
27
- @s.load_read_state.refresh_time.should == time
25
+ it "should delete read_state from source" do
26
+ time = Time.now.to_i
27
+ @s.read_state.refresh_time = time
28
+ @s.load_read_state.refresh_time.should == time
28
29
 
29
- @s.delete_user_read_state
30
- @s.load_read_state.should == nil
31
- end
32
-
30
+ @s.delete_user_read_state
31
+ @s.load_read_state.should == nil
33
32
  end
34
33
  end
@@ -1,14 +1,14 @@
1
1
  require File.join(File.dirname(__FILE__),'spec_helper')
2
2
 
3
3
  describe "Rhoconnect" do
4
- include TestHelpers
5
- let(:test_app_name) { 'application' }
4
+ include TestHelpers
5
+ let(:test_app_name) { 'application' }
6
6
 
7
- before(:each) do
7
+ before(:each) do
8
8
  Store.create
9
9
  Store.flush_all
10
10
  end
11
-
11
+
12
12
  it "should bootstrap Rhoconnect with block" do
13
13
  Rhoconnect.bootstrap(get_testapp_path) do |rhoconnect|
14
14
  rhoconnect.vendor_directory = 'foo'
@@ -31,7 +31,7 @@ describe "Rhoconnect" do
31
31
  Rhoconnect.environment.should == :production
32
32
  ENV.delete('RHO_ENV')
33
33
  end
34
-
34
+
35
35
  it "should bootstrap Rhoconnect with RACK_ENV provided" do
36
36
  env = ENV['RACK_ENV'].dup
37
37
  ENV['RACK_ENV'] = 'production'
@@ -39,7 +39,7 @@ describe "Rhoconnect" do
39
39
  Rhoconnect.environment.should == :production
40
40
  ENV['RACK_ENV'] = env
41
41
  end
42
-
42
+
43
43
  it "should bootstrap with existing app" do
44
44
  app = App.create(:name => test_app_name)
45
45
  App.should_receive(:load).once.with(test_app_name).and_return(app)
@@ -57,7 +57,7 @@ describe "Rhoconnect" do
57
57
  config[:sources]['FixedSchemaAdapter'].merge!(
58
58
  'schema' => {'property' => 'foo'}
59
59
  )
60
- Rhoconnect.stub!(:get_config).and_return(config)
60
+ Rhoconnect.stub(:get_config).and_return(config)
61
61
  Rhoconnect.should_receive(:log).once.with(
62
62
  "ERROR: 'schema' field in settings.yml is not supported anymore, please use source adapter schema method!"
63
63
  )