quickbooks_web_connector 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +109 -0
- data/Rakefile +28 -0
- data/app/assets/javascripts/quickbooks_web_connector/application.js +15 -0
- data/app/assets/stylesheets/quickbooks_web_connector/application.css +13 -0
- data/app/controllers/quickbooks_web_connector/application_controller.rb +5 -0
- data/app/controllers/quickbooks_web_connector/qwc_controller.rb +12 -0
- data/app/controllers/quickbooks_web_connector/soap_controller.rb +10 -0
- data/app/helpers/quickbooks_web_connector/application_helper.rb +4 -0
- data/app/views/layouts/quickbooks_web_connector/application.html.erb +14 -0
- data/app/views/quickbooks_web_connector/qwc/qwc.xml.builder +12 -0
- data/config/routes.rb +6 -0
- data/lib/quickbooks_web_connector/config.rb +35 -0
- data/lib/quickbooks_web_connector/engine.rb +5 -0
- data/lib/quickbooks_web_connector/job.rb +61 -0
- data/lib/quickbooks_web_connector/json_coder.rb +23 -0
- data/lib/quickbooks_web_connector/soap_wrapper/QBWebConnectorSvc.rb +72 -0
- data/lib/quickbooks_web_connector/soap_wrapper/default.rb +204 -0
- data/lib/quickbooks_web_connector/soap_wrapper/defaultMappingRegistry.rb +166 -0
- data/lib/quickbooks_web_connector/soap_wrapper/defaultServant.rb +140 -0
- data/lib/quickbooks_web_connector/soap_wrapper.rb +30 -0
- data/lib/quickbooks_web_connector/version.rb +3 -0
- data/lib/quickbooks_web_connector.rb +127 -0
- data/lib/tasks/quickbooks_web_connector_tasks.rake +4 -0
- data/spec/config/config_spec.rb +83 -0
- data/spec/controllers/quickbooks_web_connector/qwc_controller_spec.rb +29 -0
- data/spec/controllers/quickbooks_web_connector/soap_controller_spec.rb +306 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +6 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +26009 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/quickbooks_web_connector/soap_wrapper/defaultServant_spec.rb +150 -0
- data/spec/quickbooks_web_connector_spec.rb +47 -0
- data/spec/routing/quickbooks_web_connector_spec.rb +17 -0
- data/spec/spec_helper.rb +50 -0
- data/spec/support/redis/dump.rdb +1 -0
- data/spec/support/redis/redis-test.conf +115 -0
- data/spec/views/quickbooks_web_connector/qwc/qwc.xml.builder_spec.rb +56 -0
- metadata +232 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,150 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe QuickbooksWebConnector::SoapWrapper::QBWebConnectorSvcSoap do
|
4
|
+
let(:servant) { described_class.new }
|
5
|
+
|
6
|
+
describe 'serverVersion' do
|
7
|
+
subject(:response) { servant.serverVersion(stub :parameters) }
|
8
|
+
|
9
|
+
before { QuickbooksWebConnector.configure { |c| c.server_version = '1.2.3' } }
|
10
|
+
|
11
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::ServerVersionResponse }
|
12
|
+
its(:serverVersionResult) { should eq '1.2.3' }
|
13
|
+
|
14
|
+
after { QuickbooksWebConnector.configure { |c| c.server_version = '1.0.0' } }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'clientVersion' do
|
18
|
+
subject(:response) { servant.clientVersion(stub :parameters, strVersion: '2.1.0.30') }
|
19
|
+
|
20
|
+
context 'no minimum version set' do
|
21
|
+
before { QuickbooksWebConnector.configure { |c| c.minimum_web_connector_client_version = nil } }
|
22
|
+
|
23
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::ClientVersionResponse }
|
24
|
+
its(:clientVersionResult) { should be_nil }
|
25
|
+
|
26
|
+
after { QuickbooksWebConnector.configure { |c| c.minimum_web_connector_client_version = nil } }
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'current version passes minimum version check' do
|
30
|
+
before { QuickbooksWebConnector.configure { |c| c.minimum_web_connector_client_version = '1.0.0' } }
|
31
|
+
|
32
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::ClientVersionResponse }
|
33
|
+
its(:clientVersionResult) { should be_nil }
|
34
|
+
|
35
|
+
after { QuickbooksWebConnector.configure { |c| c.minimum_web_connector_client_version = nil } }
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'current version fails minimum version check' do
|
39
|
+
before { QuickbooksWebConnector.configure { |c| c.minimum_web_connector_client_version = '3.0.0' } }
|
40
|
+
|
41
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::ClientVersionResponse }
|
42
|
+
its(:clientVersionResult) { should eq 'E:This version of QuickBooks Web Connector is outdated. Version 3.0.0 or greater is required.' }
|
43
|
+
|
44
|
+
after { QuickbooksWebConnector.configure { |c| c.minimum_web_connector_client_version = nil } }
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
describe 'authenticate' do
|
50
|
+
subject(:response) { servant.authenticate(stub :parameters, strUserName: 'foo', strPassword: 'bar') }
|
51
|
+
|
52
|
+
context 'unauthorized' do
|
53
|
+
|
54
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::AuthenticateResponse }
|
55
|
+
|
56
|
+
it 'returns "nvu" with an invalid user' do
|
57
|
+
expect(response.authenticateResult[1]).to eq('nvu')
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'authorized' do
|
62
|
+
before do
|
63
|
+
QuickbooksWebConnector.configure do |c|
|
64
|
+
c.username = 'foo'
|
65
|
+
c.password = 'bar'
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
after do
|
70
|
+
QuickbooksWebConnector.configure do |c|
|
71
|
+
c.username = 'web_connector'
|
72
|
+
c.password = 'secret'
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
context 'has no data to send' do
|
77
|
+
it 'is "none" for having no data' do
|
78
|
+
expect(response.authenticateResult[1]).to eq('none')
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
context 'has work to do' do
|
83
|
+
before do
|
84
|
+
QuickbooksWebConnector.enqueue '<some><xml></xml></some>', SomeHandler
|
85
|
+
|
86
|
+
QuickbooksWebConnector.configure { |c| c.company_file_path = '/path/to/company.qbw' }
|
87
|
+
|
88
|
+
SecureRandom.stub uuid: '71f1f9d9-8012-487c-af33-c84bab4d4ded'
|
89
|
+
end
|
90
|
+
|
91
|
+
after { QuickbooksWebConnector.configure { |c| c.company_file_path = '' } }
|
92
|
+
|
93
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::AuthenticateResponse }
|
94
|
+
|
95
|
+
it 'is a token for future requests' do
|
96
|
+
expect(response.authenticateResult[0]).to eq('71f1f9d9-8012-487c-af33-c84bab4d4ded')
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'returns the path to the company file' do
|
100
|
+
expect(response.authenticateResult[1]).to eq('/path/to/company.qbw')
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'is nil for delay' do
|
104
|
+
expect(response.authenticateResult[2]).to be_nil
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'is nil for the new MinimumRunEveryNSeconds' do
|
108
|
+
expect(response.authenticateResult[3]).to be_nil
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
describe 'sendRequestXML' do
|
115
|
+
subject(:response) { servant.sendRequestXML(stub :parameters) }
|
116
|
+
|
117
|
+
before { QuickbooksWebConnector.enqueue '<some><xml></xml></some>', SomeHandler, 1 }
|
118
|
+
|
119
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::SendRequestXMLResponse }
|
120
|
+
its(:sendRequestXMLResult) { should eq '<some><xml></xml></some>' }
|
121
|
+
end
|
122
|
+
|
123
|
+
describe 'receiveResponseXML' do
|
124
|
+
subject(:response) { servant.receiveResponseXML(stub :parameters, response: '<response><xml></xml></response>') }
|
125
|
+
|
126
|
+
before do
|
127
|
+
QuickbooksWebConnector.enqueue '<request><xml></xml></request>', SomeHandler, 1
|
128
|
+
SomeHandler.should_receive(:perform).with('<response><xml></xml></response>', 1)
|
129
|
+
end
|
130
|
+
|
131
|
+
context 'last job' do
|
132
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::ReceiveResponseXMLResponse }
|
133
|
+
its(:receiveResponseXMLResult) { should eq 100 }
|
134
|
+
end
|
135
|
+
|
136
|
+
context 'additional jobs' do
|
137
|
+
before { QuickbooksWebConnector.enqueue '<other><xml></xml></other>', SomeHandler, 2 }
|
138
|
+
|
139
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::ReceiveResponseXMLResponse }
|
140
|
+
its(:receiveResponseXMLResult) { should eq 1 }
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
describe 'closeConnection' do
|
145
|
+
subject(:response) { servant.closeConnection(stub :parameters) }
|
146
|
+
|
147
|
+
it { should be_a QuickbooksWebConnector::SoapWrapper::CloseConnectionResponse }
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe QuickbooksWebConnector do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@original_redis = described_class.redis
|
7
|
+
end
|
8
|
+
|
9
|
+
after do
|
10
|
+
described_class.redis = @original_redis
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'can set a namespace through a url-like string' do
|
14
|
+
expect(described_class.redis.namespace).to eq(:qwc)
|
15
|
+
described_class.redis = 'localhost:9736/namespace'
|
16
|
+
expect(described_class.redis.namespace).to eq('namespace')
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'can set a namespace with a Redis::Namespace argument' do
|
20
|
+
new_redis = Redis.new(host: 'localhost', port: 9736)
|
21
|
+
new_namespace = Redis::Namespace.new('namespace', redis: new_redis)
|
22
|
+
described_class.redis = new_namespace
|
23
|
+
expect(described_class.redis).to eq(new_namespace)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'can enqueue jobs' do
|
27
|
+
expect(described_class.size).to eq(0)
|
28
|
+
described_class.enqueue '<some><xml></xml></some>', SomeHandler, 1, '/tmp'
|
29
|
+
|
30
|
+
job = described_class.reserve
|
31
|
+
|
32
|
+
expect(job).to be_a_kind_of(described_class::Job)
|
33
|
+
expect(job.payload_class).to eq(SomeHandler)
|
34
|
+
expect(job.args[0]).to eq 1
|
35
|
+
expect(job.args[1]).to eq '/tmp'
|
36
|
+
|
37
|
+
expect(described_class.reserve).to be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'can peek at the queue' do
|
41
|
+
described_class.push('name' => 'chris')
|
42
|
+
expect(described_class.size).to eq(1)
|
43
|
+
expect(described_class.peek).to eq('name' => 'chris')
|
44
|
+
expect(described_class.size).to eq(1)
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'QuickbooksWebConnector routing' do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@routes = QuickbooksWebConnector::Engine.routes
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'defaults to XML for downloading QWC' do
|
10
|
+
expect(get: '/qwc').to route_to(controller: 'quickbooks_web_connector/qwc', action: 'download', format: :xml)
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'routes the SOAP endpoint' do
|
14
|
+
expect(post: '/soap').to route_to(controller: 'quickbooks_web_connector/soap', action: 'endpoint')
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
4
|
+
|
5
|
+
$dir = File.dirname(File.expand_path(__FILE__))
|
6
|
+
|
7
|
+
require 'rspec/rails'
|
8
|
+
require 'rexml/document'
|
9
|
+
|
10
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
11
|
+
# in spec/support and it's subdirectories
|
12
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
13
|
+
|
14
|
+
RSpec.configure do |config|
|
15
|
+
config.expect_with :rspec do |c|
|
16
|
+
c.syntax = :expect
|
17
|
+
end
|
18
|
+
|
19
|
+
config.before(:suite) do
|
20
|
+
# Make sure we can run redis
|
21
|
+
if !system("which redis-server")
|
22
|
+
puts '', "** can't find `redis-server` in your path"
|
23
|
+
abort ''
|
24
|
+
end
|
25
|
+
|
26
|
+
# Start redis
|
27
|
+
puts "Starting redis for testing at localhost:9736"
|
28
|
+
`redis-server #{$dir}/support/redis/redis-test.conf`
|
29
|
+
QuickbooksWebConnector.redis = 'localhost:9736'
|
30
|
+
end
|
31
|
+
|
32
|
+
config.before(:each) do
|
33
|
+
QuickbooksWebConnector.redis.flushall
|
34
|
+
end
|
35
|
+
|
36
|
+
# Kill our own redis we started
|
37
|
+
config.after(:suite) do
|
38
|
+
processes = `ps -A -o pid,command | grep [r]edis-test`.split($/)
|
39
|
+
pids = processes.map { |process| process.split(" ")[0] }
|
40
|
+
puts "Killing test redis server..."
|
41
|
+
pids.each { |pid| Process.kill("TERM", pid.to_i) }
|
42
|
+
system("rm -f #{$dir}/support/redis/dump.rdb")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# fixture classes
|
47
|
+
class SomeHandler
|
48
|
+
def self.perform(response_xml, *args)
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
REDIS0006�ܳC�Z��V
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# Redis configuration file example
|
2
|
+
|
3
|
+
# By default Redis does not run as a daemon. Use 'yes' if you need it.
|
4
|
+
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
|
5
|
+
daemonize yes
|
6
|
+
|
7
|
+
# When run as a daemon, Redis write a pid file in /var/run/redis.pid by default.
|
8
|
+
# You can specify a custom pid file location here.
|
9
|
+
pidfile ./spec/support/redis/redis-test.pid
|
10
|
+
|
11
|
+
# Accept connections on the specified port, default is 6379
|
12
|
+
port 9736
|
13
|
+
|
14
|
+
# If you want you can bind a single interface, if the bind option is not
|
15
|
+
# specified all the interfaces will listen for connections.
|
16
|
+
#
|
17
|
+
# bind 127.0.0.1
|
18
|
+
|
19
|
+
# Close the connection after a client is idle for N seconds (0 to disable)
|
20
|
+
timeout 300
|
21
|
+
|
22
|
+
# Save the DB on disk:
|
23
|
+
#
|
24
|
+
# save <seconds> <changes>
|
25
|
+
#
|
26
|
+
# Will save the DB if both the given number of seconds and the given
|
27
|
+
# number of write operations against the DB occurred.
|
28
|
+
#
|
29
|
+
# In the example below the behaviour will be to save:
|
30
|
+
# after 900 sec (15 min) if at least 1 key changed
|
31
|
+
# after 300 sec (5 min) if at least 10 keys changed
|
32
|
+
# after 60 sec if at least 10000 keys changed
|
33
|
+
save 900 1
|
34
|
+
save 300 10
|
35
|
+
save 60 10000
|
36
|
+
|
37
|
+
# The filename where to dump the DB
|
38
|
+
dbfilename dump.rdb
|
39
|
+
|
40
|
+
# For default save/load DB in/from the working directory
|
41
|
+
# Note that you must specify a directory not a file name.
|
42
|
+
dir ./spec/support/redis/
|
43
|
+
|
44
|
+
# Set server verbosity to 'debug'
|
45
|
+
# it can be one of:
|
46
|
+
# debug (a lot of information, useful for development/testing)
|
47
|
+
# notice (moderately verbose, what you want in production probably)
|
48
|
+
# warning (only very important / critical messages are logged)
|
49
|
+
loglevel debug
|
50
|
+
|
51
|
+
# Specify the log file name. Also 'stdout' can be used to force
|
52
|
+
# the demon to log on the standard output. Note that if you use standard
|
53
|
+
# output for logging but daemonize, logs will be sent to /dev/null
|
54
|
+
logfile stdout
|
55
|
+
|
56
|
+
# Set the number of databases. The default database is DB 0, you can select
|
57
|
+
# a different one on a per-connection basis using SELECT <dbid> where
|
58
|
+
# dbid is a number between 0 and 'databases'-1
|
59
|
+
databases 16
|
60
|
+
|
61
|
+
################################# REPLICATION #################################
|
62
|
+
|
63
|
+
# Master-Slave replication. Use slaveof to make a Redis instance a copy of
|
64
|
+
# another Redis server. Note that the configuration is local to the slave
|
65
|
+
# so for example it is possible to configure the slave to save the DB with a
|
66
|
+
# different interval, or to listen to another port, and so on.
|
67
|
+
|
68
|
+
# slaveof <masterip> <masterport>
|
69
|
+
|
70
|
+
################################## SECURITY ###################################
|
71
|
+
|
72
|
+
# Require clients to issue AUTH <PASSWORD> before processing any other
|
73
|
+
# commands. This might be useful in environments in which you do not trust
|
74
|
+
# others with access to the host running redis-server.
|
75
|
+
#
|
76
|
+
# This should stay commented out for backward compatibility and because most
|
77
|
+
# people do not need auth (e.g. they run their own servers).
|
78
|
+
|
79
|
+
# requirepass foobared
|
80
|
+
|
81
|
+
################################### LIMITS ####################################
|
82
|
+
|
83
|
+
# Set the max number of connected clients at the same time. By default there
|
84
|
+
# is no limit, and it's up to the number of file descriptors the Redis process
|
85
|
+
# is able to open. The special value '0' means no limts.
|
86
|
+
# Once the limit is reached Redis will close all the new connections sending
|
87
|
+
# an error 'max number of clients reached'.
|
88
|
+
|
89
|
+
# maxclients 128
|
90
|
+
|
91
|
+
# Don't use more memory than the specified amount of bytes.
|
92
|
+
# When the memory limit is reached Redis will try to remove keys with an
|
93
|
+
# EXPIRE set. It will try to start freeing keys that are going to expire
|
94
|
+
# in little time and preserve keys with a longer time to live.
|
95
|
+
# Redis will also try to remove objects from free lists if possible.
|
96
|
+
#
|
97
|
+
# If all this fails, Redis will start to reply with errors to commands
|
98
|
+
# that will use more memory, like SET, LPUSH, and so on, and will continue
|
99
|
+
# to reply to most read-only commands like GET.
|
100
|
+
#
|
101
|
+
# WARNING: maxmemory can be a good idea mainly if you want to use Redis as a
|
102
|
+
# 'state' server or cache, not as a real DB. When Redis is used as a real
|
103
|
+
# database the memory usage will grow over the weeks, it will be obvious if
|
104
|
+
# it is going to use too much memory in the long run, and you'll have the time
|
105
|
+
# to upgrade. With maxmemory after the limit is reached you'll start to get
|
106
|
+
# errors for write operations, and this may even lead to DB inconsistency.
|
107
|
+
|
108
|
+
# maxmemory <bytes>
|
109
|
+
|
110
|
+
############################### ADVANCED CONFIG ###############################
|
111
|
+
|
112
|
+
# Glue small output buffers together in order to send small replies in a
|
113
|
+
# single TCP packet. Uses a bit more CPU but most of the times it is a win
|
114
|
+
# in terms of number of queries per second. Use 'yes' if unsure.
|
115
|
+
# glueoutputbuf yes
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rexml/document'
|
3
|
+
|
4
|
+
describe 'quickbooks_web_connector/qwc/qwc' do
|
5
|
+
|
6
|
+
before do
|
7
|
+
QuickbooksWebConnector.configure { |c| c.username = 'jsmith' }
|
8
|
+
|
9
|
+
render
|
10
|
+
end
|
11
|
+
|
12
|
+
after { QuickbooksWebConnector.configure { |c| c.username = 'web_connector' } }
|
13
|
+
|
14
|
+
let(:root) { REXML::Document.new(rendered).root }
|
15
|
+
|
16
|
+
it 'wraps everything in a QBWCXML element' do
|
17
|
+
expect(root.name).to eq('QBWCXML')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'includes the app name' do
|
21
|
+
expect(root.text('AppName')).to eq('My QBWC App')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'includes the app ID' do
|
25
|
+
expect(root.text('AppID')).to be_nil
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'includes the endpoint url' do
|
29
|
+
expect(root.text('AppURL')).to eq('http://test.host/quickbooks_web_connector/soap')
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'includes the description' do
|
33
|
+
expect(root.text('AppDescription')).to eq('My QBWC App Description')
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'includes the support url' do
|
37
|
+
expect(root.text('AppSupport')).to eq('http://test.host/')
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'includes the username' do
|
41
|
+
expect(root.text('UserName')).to eq('jsmith')
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'includes the owner id' do
|
45
|
+
expect(root.text('OwnerID')).to eq('{d69682e6-4436-44bc-bd19-d6bfbd11778d}')
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'includes the file id' do
|
49
|
+
expect(root.text('FileID')).to eq('{916222f3-c574-4c70-8c9d-e3cec2634e49}')
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'sets the type to QBFS' do
|
53
|
+
expect(root.text('QBType')).to eq('QBFS')
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|