rhoconnect 5.1.1 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -8
- data/CREDITS +100 -100
- data/Gemfile +0 -2
- data/Gemfile.lock +56 -71
- data/LICENSE +5 -72
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bench/bench +0 -0
- data/bench/benchapp/settings/settings.yml +0 -3
- data/bench/blobapp/settings/settings.yml +0 -3
- data/bench/distr_bench/distr_bench +0 -0
- data/bench/distr_bench/distr_bench_main +0 -0
- data/bench/distr_bench/run_distr_client.sh +0 -0
- data/bench/distr_bench/run_test_query_script.sh +0 -0
- data/bench/lib/bench/bench_result_processor.rb +0 -0
- data/bench/lib/bench.rb +0 -8
- data/bench/lib/testdata/images/icon.ico +0 -0
- data/bench/lib/testdata/images/icon.png +0 -0
- data/bench/lib/testdata/images/loading-Landscape.png +0 -0
- data/bench/lib/testdata/images/loading-LandscapeLeft.png +0 -0
- data/bench/lib/testdata/images/loading-LandscapeRight.png +0 -0
- data/bench/lib/testdata/images/loading-Portrait.png +0 -0
- data/bench/lib/testdata/images/loading-PortraitUpsideDown.png +0 -0
- data/bench/lib/testdata/images/loading.png +0 -0
- data/bench/lib/testdata/images/loading@2x.png +0 -0
- data/bench/prepare_bench +0 -0
- data/bench/run_bench.sh +0 -0
- data/bench/run_blob_script.sh +0 -0
- data/bench/run_cud_script.sh +0 -0
- data/bench/run_query_md_script.sh +0 -0
- data/bench/run_query_only_script.sh +0 -0
- data/bench/run_query_script.sh +0 -0
- data/bench/run_test_query_script.sh +0 -0
- data/bench/run_test_source_script.sh +0 -0
- data/bin/rhoconnect-benchmark +0 -22
- data/commands/rhoconnect/restart.rb +0 -1
- data/commands/rhoconnect/start.rb +2 -14
- data/doc/adapters-crm.txt +1 -1
- data/doc/benchmarks-running.txt +1 -1
- data/doc/benchmarks.txt +0 -1
- data/doc/bulk-sync.txt +0 -1
- data/doc/command-line.txt +0 -6
- data/doc/java-plugin.txt +0 -6
- data/doc/preparing-production.txt +1 -7
- data/doc/public/cli.txt +0 -2
- data/doc/public/css/print.css +0 -0
- data/doc/public/css/screen.css +0 -0
- data/doc/public/css/style.css +0 -0
- data/doc/push-client-setup-android.txt +0 -1
- data/doc/push-client-setup-ios.txt +0 -1
- data/doc/push-client-setup-rps.txt +3 -3
- data/doc/push-server-setup.txt +1 -4
- data/doc/rails-plugin.txt +0 -5
- data/doc/rest-api.txt +2 -14
- data/doc/rhoconnect-redis-stack.txt +0 -1
- data/doc/settings.txt +0 -3
- data/doc/supported-platforms.txt +0 -1
- data/doc/tutorial.txt +0 -2
- data/examples/simple/config.ru +0 -0
- data/examples/simple/settings/settings.yml +1 -4
- data/generators/rhoconnect.rb +0 -1
- data/generators/templates/application/config.ru +0 -0
- data/generators/templates/application/rcgemfile +1 -0
- data/generators/templates/application/settings/settings.yml +0 -3
- data/install.sh +0 -0
- data/installer/utils/create_sha1.rb +0 -0
- data/installer/utils/delete_from_s3.rb +0 -0
- data/installer/utils/download_from_s3.rb +0 -0
- data/installer/utils/nix_install_test.rb +0 -0
- data/installer/utils/package_upload/repos.rake +2 -2
- data/installer/utils/package_upload/s3_single_file.rb +0 -0
- data/installer/utils/package_upload/s3_upload.rb +0 -0
- data/installer/utils/verify_checksum.rb +0 -0
- data/lib/rhoconnect/api_token.rb +0 -0
- data/lib/rhoconnect/app.rb +0 -0
- data/lib/rhoconnect/bulk_data/bulk_data.rb +0 -0
- data/lib/rhoconnect/bulk_data/syncdb.index.schema +0 -0
- data/lib/rhoconnect/bulk_data/syncdb.schema +0 -0
- data/lib/rhoconnect/bulk_data.rb +0 -0
- data/lib/rhoconnect/client.rb +0 -2
- data/lib/rhoconnect/controller/system_controller.rb +0 -9
- data/lib/rhoconnect/credential.rb +0 -0
- data/lib/rhoconnect/document.rb +0 -0
- data/lib/rhoconnect/middleware/cors.rb +209 -209
- data/lib/rhoconnect/middleware/x_domain_session_wrapper.rb +57 -57
- data/lib/rhoconnect/model/base.rb +0 -0
- data/lib/rhoconnect/read_state.rb +0 -0
- data/lib/rhoconnect/rho_indifferent_access.rb +0 -0
- data/lib/rhoconnect/server.rb +0 -0
- data/lib/rhoconnect/source.rb +0 -0
- data/lib/rhoconnect/store.rb +2 -0
- data/lib/rhoconnect/store_orm.rb +0 -0
- data/lib/rhoconnect/user.rb +0 -0
- data/lib/rhoconnect/version.rb +1 -1
- data/lib/rhoconnect/web-console/models/doc.js +0 -13
- data/lib/rhoconnect/web-console/models/source.js +0 -31
- data/lib/rhoconnect/web-console/public/logo.png +0 -0
- data/lib/rhoconnect/web-console/server.rb +0 -0
- data/lib/rhoconnect/web-console/templates/index.erb +1 -2
- data/lib/rhoconnect/web-console/views/home.js +4 -6
- data/lib/rhoconnect.rb +1 -3
- data/spec/api/api_helper.rb +0 -0
- data/spec/api/system/login_spec.rb +0 -0
- data/spec/api/system/reset_spec.rb +0 -0
- data/spec/api/user/create_user_spec.rb +0 -0
- data/spec/api/user/update_user_spec.rb +0 -0
- data/spec/api_token_spec.rb +0 -0
- data/spec/app_spec.rb +0 -0
- data/spec/apps/emptyapp/settings/settings.yml +1 -4
- data/spec/apps/jstestapp/settings/settings.yml +0 -3
- data/spec/apps/rhotestapp/controllers/ruby/application_controller.rb +0 -0
- data/spec/apps/rhotestapp/models/ruby/sample_adapter.rb +0 -0
- data/spec/apps/rhotestapp/models/ruby/simple_adapter.rb +0 -0
- data/spec/apps/rhotestapp/settings/settings.yml +0 -3
- data/spec/apps/rhotestapp/vendor/mygem-0.1.0/lib/mygem/mygem.rb +0 -0
- data/spec/apps/rhotestapp/vendor/mygem-0.1.0/lib/mygem.rb +0 -0
- data/spec/bulk_data/bulk_data_spec.rb +0 -0
- data/spec/client_spec.rb +0 -14
- data/spec/client_sync_spec.rb +0 -0
- data/spec/doc/base.html +0 -0
- data/spec/doc/doc_spec.rb +0 -0
- data/spec/doc/footer.html +0 -0
- data/spec/doc/header.html +0 -0
- data/spec/document_spec.rb +0 -0
- data/spec/generator/generator_spec.rb +1 -3
- data/spec/jobs/bulk_data_job_spec.rb +0 -0
- data/spec/perf/bulk_data_perf_spec.rb +0 -0
- data/spec/perf/perf_spec_helper.rb +0 -0
- data/spec/perf/store_perf_spec.rb +0 -0
- data/spec/read_state_spec.rb +0 -0
- data/spec/server/cors_spec.rb +283 -283
- data/spec/server/server_spec.rb +0 -15
- data/spec/server/x_domain_session_wrapper_spec.rb +150 -150
- data/spec/source_adapter_spec.rb +0 -0
- data/spec/source_spec.rb +0 -0
- data/spec/source_sync_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/store_orm_spec.rb +0 -0
- data/spec/store_spec.rb +0 -0
- data/spec/sync_states_spec.rb +0 -0
- data/spec/testdata/1000-data.txt +0 -0
- data/spec/testdata/compressed/compress-data.txt +0 -0
- data/spec/user_spec.rb +0 -9
- metadata +116 -132
- data/bench/benchapp/settings/license.key +0 -1
- data/bench/blobapp/settings/license.key +0 -1
- data/doc/licensing.txt +0 -18
- data/examples/simple/settings/license.key +0 -1
- data/generators/templates/application/settings/license.key +0 -1
- data/lib/rhoconnect/license.rb +0 -94
- data/spec/api/system/get_license_info_spec.rb +0 -15
- data/spec/apps/emptyapp/settings/license.key +0 -1
- data/spec/apps/jstestapp/settings/license.key +0 -1
- data/spec/apps/rhotestapp/settings/license.key +0 -1
- data/spec/license_spec.rb +0 -67
@@ -1,150 +1,150 @@
|
|
1
|
-
require 'rhoconnect/middleware/x_domain_session_wrapper'
|
2
|
-
require File.join(File.dirname(__FILE__),'..','spec_helper')
|
3
|
-
|
4
|
-
require "cgi"
|
5
|
-
|
6
|
-
COOKIE_NAME = 'some_cookie'
|
7
|
-
COOKIE_VALUE = 'some_session_key=some_session_value'
|
8
|
-
|
9
|
-
COOKIE_NV = "#{COOKIE_NAME}=#{COOKIE_VALUE}"
|
10
|
-
COOKIE_ANOTHER_NV = "#{COOKIE_NAME}=#{COOKIE_VALUE}_another"
|
11
|
-
|
12
|
-
PROPER_QUERY_STRING = "?abc=123&#{COOKIE_NAME}=#{CGI.escape(COOKIE_VALUE)}&de=45"
|
13
|
-
WRONG_QUERY_STRING = "?abc=123&#{COOKIE_NAME}_wrong=#{CGI.escape(COOKIE_VALUE)}&de=45"
|
14
|
-
|
15
|
-
PROPER_URI_NEW = '/api/application'
|
16
|
-
PROPER_URI_OLD = '/application'
|
17
|
-
WRONG_URI = '/some/wrong/path/to/rhoconnect/application'
|
18
|
-
|
19
|
-
LOGIN_URI_NEW = '/api/application/clientlogin'
|
20
|
-
LOGIN_URI_OLD = '/application/clientlogin'
|
21
|
-
|
22
|
-
describe "XDomainSessionWrapper middleware" do
|
23
|
-
|
24
|
-
class StubApp
|
25
|
-
def call(env)
|
26
|
-
[200, {'Set-Cookie' => COOKIE_ANOTHER_NV, 'Content-Length' => '0'}, ['']]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
before(:each) do
|
31
|
-
app ||= StubApp.new
|
32
|
-
|
33
|
-
@middleware_new_routes = Rhoconnect::Middleware::XDomainSessionWrapper.new(app, {
|
34
|
-
:session_cookie => COOKIE_NAME,
|
35
|
-
:api_uri_regexp => /\A\/api\/application/,
|
36
|
-
:login_uri_regexp => /\A\/api\/application\/clientlogin/
|
37
|
-
})
|
38
|
-
|
39
|
-
@middleware_old_routes = Rhoconnect::Middleware::XDomainSessionWrapper.new(app, {
|
40
|
-
:session_cookie => COOKIE_NAME,
|
41
|
-
:api_uri_regexp => /\A\/application/,
|
42
|
-
:login_uri_regexp => /\A\/application\/clientlogin/
|
43
|
-
})
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should skip if it isn't a sync protocol URI, for new REST routes" do
|
48
|
-
env = {
|
49
|
-
'PATH_INFO' => WRONG_URI,
|
50
|
-
'QUERY_STRING' => PROPER_QUERY_STRING
|
51
|
-
}
|
52
|
-
status, headers, body = @middleware_new_routes.call(env)
|
53
|
-
200.should == status
|
54
|
-
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
55
|
-
COOKIE_NV.should_not == env['HTTP_COOKIE']
|
56
|
-
headers['Content-Length'].should == body[0].length.to_s
|
57
|
-
''.should == body[0]
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should skip if it isn't a sync protocol URI, for old REST routes" do
|
61
|
-
env = {
|
62
|
-
'PATH_INFO' => WRONG_URI,
|
63
|
-
'QUERY_STRING' => PROPER_QUERY_STRING
|
64
|
-
}
|
65
|
-
status, headers, body = @middleware_old_routes.call(env)
|
66
|
-
200.should == status
|
67
|
-
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
68
|
-
COOKIE_NV.should_not == env['HTTP_COOKIE']
|
69
|
-
headers['Content-Length'].should == body[0].length.to_s
|
70
|
-
''.should == body[0]
|
71
|
-
end
|
72
|
-
|
73
|
-
it "should process cookie from QUERY_STRING if it is a sync protocol URI, for new REST routes" do
|
74
|
-
env = {
|
75
|
-
'PATH_INFO' => PROPER_URI_NEW,
|
76
|
-
'QUERY_STRING' => PROPER_QUERY_STRING
|
77
|
-
}
|
78
|
-
status, headers, body = @middleware_new_routes.call(env)
|
79
|
-
200.should == status
|
80
|
-
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
81
|
-
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
82
|
-
headers['Content-Length'].should == body[0].length.to_s
|
83
|
-
''.should == body[0]
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should process cookie from QUERY_STRING if it is a sync protocol URI, for old REST routes" do
|
87
|
-
env = {
|
88
|
-
'PATH_INFO' => PROPER_URI_OLD,
|
89
|
-
'QUERY_STRING' => PROPER_QUERY_STRING
|
90
|
-
}
|
91
|
-
status, headers, body = @middleware_old_routes.call(env)
|
92
|
-
200.should == status
|
93
|
-
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
94
|
-
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
95
|
-
headers['Content-Length'].should == body[0].length.to_s
|
96
|
-
''.should == body[0]
|
97
|
-
end
|
98
|
-
|
99
|
-
it "shouldn't process cookie from QUERY_STRING if there is no appropriate parameter name or value, for new REST routes" do
|
100
|
-
env = {
|
101
|
-
'PATH_INFO' => PROPER_URI_NEW,
|
102
|
-
'QUERY_STRING' => WRONG_QUERY_STRING
|
103
|
-
}
|
104
|
-
status, headers, body = @middleware_new_routes.call(env)
|
105
|
-
200.should == status
|
106
|
-
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
107
|
-
env['HTTP_COOKIE'].should_not == COOKIE_VALUE
|
108
|
-
headers['Content-Length'].should == body[0].length.to_s
|
109
|
-
''.should == body[0]
|
110
|
-
end
|
111
|
-
|
112
|
-
it "shouldn't process cookie from QUERY_STRING if there is no appropriate parameter name or value, for old REST routes" do
|
113
|
-
env = {
|
114
|
-
'PATH_INFO' => PROPER_URI_OLD,
|
115
|
-
'QUERY_STRING' => WRONG_QUERY_STRING
|
116
|
-
}
|
117
|
-
status, headers, body = @middleware_old_routes.call(env)
|
118
|
-
200.should == status
|
119
|
-
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
120
|
-
env['HTTP_COOKIE'].should_not == COOKIE_VALUE
|
121
|
-
headers['Content-Length'].should == body[0].length.to_s
|
122
|
-
''.should == body[0]
|
123
|
-
end
|
124
|
-
|
125
|
-
it "should respond with cookie in a body if it is a login URI, for new REST routes" do
|
126
|
-
env = {
|
127
|
-
'PATH_INFO' => LOGIN_URI_NEW,
|
128
|
-
'QUERY_STRING' => PROPER_QUERY_STRING
|
129
|
-
}
|
130
|
-
status, headers, body = @middleware_new_routes.call(env)
|
131
|
-
200.should == status
|
132
|
-
headers['Set-Cookie'].should == COOKIE_ANOTHER_NV
|
133
|
-
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
134
|
-
headers['Content-Length'].should == body[0].length.to_s
|
135
|
-
''.should_not == body[0]
|
136
|
-
end
|
137
|
-
|
138
|
-
it "should respond with cookie in a body if it is a login URI, for old REST routes" do
|
139
|
-
env = {
|
140
|
-
'PATH_INFO' => LOGIN_URI_OLD,
|
141
|
-
'QUERY_STRING' => PROPER_QUERY_STRING
|
142
|
-
}
|
143
|
-
status, headers, body = @middleware_old_routes.call(env)
|
144
|
-
200.should == status
|
145
|
-
headers['Set-Cookie'].should == COOKIE_ANOTHER_NV
|
146
|
-
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
147
|
-
headers['Content-Length'].should == body[0].length.to_s
|
148
|
-
''.should_not == body[0]
|
149
|
-
end
|
150
|
-
end
|
1
|
+
require 'rhoconnect/middleware/x_domain_session_wrapper'
|
2
|
+
require File.join(File.dirname(__FILE__),'..','spec_helper')
|
3
|
+
|
4
|
+
require "cgi"
|
5
|
+
|
6
|
+
COOKIE_NAME = 'some_cookie'
|
7
|
+
COOKIE_VALUE = 'some_session_key=some_session_value'
|
8
|
+
|
9
|
+
COOKIE_NV = "#{COOKIE_NAME}=#{COOKIE_VALUE}"
|
10
|
+
COOKIE_ANOTHER_NV = "#{COOKIE_NAME}=#{COOKIE_VALUE}_another"
|
11
|
+
|
12
|
+
PROPER_QUERY_STRING = "?abc=123&#{COOKIE_NAME}=#{CGI.escape(COOKIE_VALUE)}&de=45"
|
13
|
+
WRONG_QUERY_STRING = "?abc=123&#{COOKIE_NAME}_wrong=#{CGI.escape(COOKIE_VALUE)}&de=45"
|
14
|
+
|
15
|
+
PROPER_URI_NEW = '/api/application'
|
16
|
+
PROPER_URI_OLD = '/application'
|
17
|
+
WRONG_URI = '/some/wrong/path/to/rhoconnect/application'
|
18
|
+
|
19
|
+
LOGIN_URI_NEW = '/api/application/clientlogin'
|
20
|
+
LOGIN_URI_OLD = '/application/clientlogin'
|
21
|
+
|
22
|
+
describe "XDomainSessionWrapper middleware" do
|
23
|
+
|
24
|
+
class StubApp
|
25
|
+
def call(env)
|
26
|
+
[200, {'Set-Cookie' => COOKIE_ANOTHER_NV, 'Content-Length' => '0'}, ['']]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
before(:each) do
|
31
|
+
app ||= StubApp.new
|
32
|
+
|
33
|
+
@middleware_new_routes = Rhoconnect::Middleware::XDomainSessionWrapper.new(app, {
|
34
|
+
:session_cookie => COOKIE_NAME,
|
35
|
+
:api_uri_regexp => /\A\/api\/application/,
|
36
|
+
:login_uri_regexp => /\A\/api\/application\/clientlogin/
|
37
|
+
})
|
38
|
+
|
39
|
+
@middleware_old_routes = Rhoconnect::Middleware::XDomainSessionWrapper.new(app, {
|
40
|
+
:session_cookie => COOKIE_NAME,
|
41
|
+
:api_uri_regexp => /\A\/application/,
|
42
|
+
:login_uri_regexp => /\A\/application\/clientlogin/
|
43
|
+
})
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should skip if it isn't a sync protocol URI, for new REST routes" do
|
48
|
+
env = {
|
49
|
+
'PATH_INFO' => WRONG_URI,
|
50
|
+
'QUERY_STRING' => PROPER_QUERY_STRING
|
51
|
+
}
|
52
|
+
status, headers, body = @middleware_new_routes.call(env)
|
53
|
+
200.should == status
|
54
|
+
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
55
|
+
COOKIE_NV.should_not == env['HTTP_COOKIE']
|
56
|
+
headers['Content-Length'].should == body[0].length.to_s
|
57
|
+
''.should == body[0]
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should skip if it isn't a sync protocol URI, for old REST routes" do
|
61
|
+
env = {
|
62
|
+
'PATH_INFO' => WRONG_URI,
|
63
|
+
'QUERY_STRING' => PROPER_QUERY_STRING
|
64
|
+
}
|
65
|
+
status, headers, body = @middleware_old_routes.call(env)
|
66
|
+
200.should == status
|
67
|
+
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
68
|
+
COOKIE_NV.should_not == env['HTTP_COOKIE']
|
69
|
+
headers['Content-Length'].should == body[0].length.to_s
|
70
|
+
''.should == body[0]
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should process cookie from QUERY_STRING if it is a sync protocol URI, for new REST routes" do
|
74
|
+
env = {
|
75
|
+
'PATH_INFO' => PROPER_URI_NEW,
|
76
|
+
'QUERY_STRING' => PROPER_QUERY_STRING
|
77
|
+
}
|
78
|
+
status, headers, body = @middleware_new_routes.call(env)
|
79
|
+
200.should == status
|
80
|
+
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
81
|
+
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
82
|
+
headers['Content-Length'].should == body[0].length.to_s
|
83
|
+
''.should == body[0]
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should process cookie from QUERY_STRING if it is a sync protocol URI, for old REST routes" do
|
87
|
+
env = {
|
88
|
+
'PATH_INFO' => PROPER_URI_OLD,
|
89
|
+
'QUERY_STRING' => PROPER_QUERY_STRING
|
90
|
+
}
|
91
|
+
status, headers, body = @middleware_old_routes.call(env)
|
92
|
+
200.should == status
|
93
|
+
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
94
|
+
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
95
|
+
headers['Content-Length'].should == body[0].length.to_s
|
96
|
+
''.should == body[0]
|
97
|
+
end
|
98
|
+
|
99
|
+
it "shouldn't process cookie from QUERY_STRING if there is no appropriate parameter name or value, for new REST routes" do
|
100
|
+
env = {
|
101
|
+
'PATH_INFO' => PROPER_URI_NEW,
|
102
|
+
'QUERY_STRING' => WRONG_QUERY_STRING
|
103
|
+
}
|
104
|
+
status, headers, body = @middleware_new_routes.call(env)
|
105
|
+
200.should == status
|
106
|
+
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
107
|
+
env['HTTP_COOKIE'].should_not == COOKIE_VALUE
|
108
|
+
headers['Content-Length'].should == body[0].length.to_s
|
109
|
+
''.should == body[0]
|
110
|
+
end
|
111
|
+
|
112
|
+
it "shouldn't process cookie from QUERY_STRING if there is no appropriate parameter name or value, for old REST routes" do
|
113
|
+
env = {
|
114
|
+
'PATH_INFO' => PROPER_URI_OLD,
|
115
|
+
'QUERY_STRING' => WRONG_QUERY_STRING
|
116
|
+
}
|
117
|
+
status, headers, body = @middleware_old_routes.call(env)
|
118
|
+
200.should == status
|
119
|
+
COOKIE_ANOTHER_NV.should == headers['Set-Cookie']
|
120
|
+
env['HTTP_COOKIE'].should_not == COOKIE_VALUE
|
121
|
+
headers['Content-Length'].should == body[0].length.to_s
|
122
|
+
''.should == body[0]
|
123
|
+
end
|
124
|
+
|
125
|
+
it "should respond with cookie in a body if it is a login URI, for new REST routes" do
|
126
|
+
env = {
|
127
|
+
'PATH_INFO' => LOGIN_URI_NEW,
|
128
|
+
'QUERY_STRING' => PROPER_QUERY_STRING
|
129
|
+
}
|
130
|
+
status, headers, body = @middleware_new_routes.call(env)
|
131
|
+
200.should == status
|
132
|
+
headers['Set-Cookie'].should == COOKIE_ANOTHER_NV
|
133
|
+
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
134
|
+
headers['Content-Length'].should == body[0].length.to_s
|
135
|
+
''.should_not == body[0]
|
136
|
+
end
|
137
|
+
|
138
|
+
it "should respond with cookie in a body if it is a login URI, for old REST routes" do
|
139
|
+
env = {
|
140
|
+
'PATH_INFO' => LOGIN_URI_OLD,
|
141
|
+
'QUERY_STRING' => PROPER_QUERY_STRING
|
142
|
+
}
|
143
|
+
status, headers, body = @middleware_old_routes.call(env)
|
144
|
+
200.should == status
|
145
|
+
headers['Set-Cookie'].should == COOKIE_ANOTHER_NV
|
146
|
+
env['HTTP_COOKIE'].should == COOKIE_VALUE
|
147
|
+
headers['Content-Length'].should == body[0].length.to_s
|
148
|
+
''.should_not == body[0]
|
149
|
+
end
|
150
|
+
end
|
data/spec/source_adapter_spec.rb
CHANGED
File without changes
|
data/spec/source_spec.rb
CHANGED
File without changes
|
data/spec/source_sync_spec.rb
CHANGED
File without changes
|
data/spec/spec_helper.rb
CHANGED
File without changes
|
data/spec/store_orm_spec.rb
CHANGED
File without changes
|
data/spec/store_spec.rb
CHANGED
File without changes
|
data/spec/sync_states_spec.rb
CHANGED
File without changes
|
data/spec/testdata/1000-data.txt
CHANGED
File without changes
|
File without changes
|
data/spec/user_spec.rb
CHANGED
@@ -23,15 +23,6 @@ describe "User" do
|
|
23
23
|
Store.get_value('user:count').should == "2"
|
24
24
|
end
|
25
25
|
|
26
|
-
it "should delete seats for user's clients" do
|
27
|
-
@c_fields.delete(:id)
|
28
|
-
Client.create(@c_fields,{:source_name => @s_fields[:name]})
|
29
|
-
c_size = @u.clients.members.size
|
30
|
-
current = Store.get_value(License::CLIENT_DOCKEY).to_i
|
31
|
-
@u.delete
|
32
|
-
Store.get_value(License::CLIENT_DOCKEY).to_i.should == current - c_size
|
33
|
-
end
|
34
|
-
|
35
26
|
it "should create token for user" do
|
36
27
|
token = @u.create_token
|
37
28
|
token.length.should == 32
|