relaxdb 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.textile +200 -0
- data/Rakefile +63 -0
- data/docs/spec_results.html +1059 -0
- data/lib/more/atomic_bulk_save_support.rb +18 -0
- data/lib/more/grapher.rb +48 -0
- data/lib/relaxdb.rb +50 -0
- data/lib/relaxdb/all_delegator.rb +44 -0
- data/lib/relaxdb/belongs_to_proxy.rb +29 -0
- data/lib/relaxdb/design_doc.rb +57 -0
- data/lib/relaxdb/document.rb +600 -0
- data/lib/relaxdb/extlib.rb +24 -0
- data/lib/relaxdb/has_many_proxy.rb +101 -0
- data/lib/relaxdb/has_one_proxy.rb +42 -0
- data/lib/relaxdb/migration.rb +40 -0
- data/lib/relaxdb/migration_version.rb +21 -0
- data/lib/relaxdb/net_http_server.rb +61 -0
- data/lib/relaxdb/paginate_params.rb +53 -0
- data/lib/relaxdb/paginator.rb +88 -0
- data/lib/relaxdb/query.rb +76 -0
- data/lib/relaxdb/references_many_proxy.rb +97 -0
- data/lib/relaxdb/relaxdb.rb +250 -0
- data/lib/relaxdb/server.rb +109 -0
- data/lib/relaxdb/taf2_curb_server.rb +63 -0
- data/lib/relaxdb/uuid_generator.rb +21 -0
- data/lib/relaxdb/validators.rb +11 -0
- data/lib/relaxdb/view_object.rb +34 -0
- data/lib/relaxdb/view_result.rb +18 -0
- data/lib/relaxdb/view_uploader.rb +49 -0
- data/lib/relaxdb/views.rb +114 -0
- data/readme.rb +80 -0
- data/spec/belongs_to_spec.rb +124 -0
- data/spec/callbacks_spec.rb +80 -0
- data/spec/derived_properties_spec.rb +112 -0
- data/spec/design_doc_spec.rb +34 -0
- data/spec/doc_inheritable_spec.rb +100 -0
- data/spec/document_spec.rb +545 -0
- data/spec/has_many_spec.rb +202 -0
- data/spec/has_one_spec.rb +123 -0
- data/spec/migration_spec.rb +97 -0
- data/spec/migration_version_spec.rb +28 -0
- data/spec/paginate_params_spec.rb +15 -0
- data/spec/paginate_spec.rb +360 -0
- data/spec/query_spec.rb +90 -0
- data/spec/references_many_spec.rb +173 -0
- data/spec/relaxdb_spec.rb +364 -0
- data/spec/server_spec.rb +32 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +65 -0
- data/spec/spec_models.rb +199 -0
- data/spec/view_by_spec.rb +76 -0
- data/spec/view_object_spec.rb +47 -0
- data/spec/view_spec.rb +23 -0
- metadata +137 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Paul Carey
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
h3. What's New?
|
2
|
+
|
3
|
+
* 2009-08-15
|
4
|
+
** A few tweaks, patches and fixes push the version to 0.3.5, compatible with CouchDB 0.9.1 and the 0.10 branch.
|
5
|
+
** The Rails error_messages_for helper is now supported. Thanks to "Balint Erdi":http://github.com/balinterdi.
|
6
|
+
* 2009-05-27
|
7
|
+
** Added minimal support for data migrations. Although CouchDB's nature removes the necessity for migrations, certain knowledge that all objects possess a particular property can simplify client logic. This desire for simplification is the rationale behind this change.
|
8
|
+
* 2009-04-19
|
9
|
+
** Defaults to taf2-curb, falling back to Net/HTTP if it taf2-curb can't be loaded. Thanks to "Fred Cheung":http://www.spacevatican.org/2009/4/13/fun-with-ruby-http-clients.
|
10
|
+
** For those interested in using RelaxDB with an ETag based cache, "look here":http://github.com/fcheung/relaxdb/commit/1d9acfd5f6b3c23da0d275252b6a6e064865440e
|
11
|
+
|
12
|
+
* 2009-03-31
|
13
|
+
** RelaxDB 0.3 released - compatible with CouchDB 0.9.
|
14
|
+
|
15
|
+
h2. Overview
|
16
|
+
|
17
|
+
RelaxDB provides a Ruby interface to CouchDB. It offers a simple idiom for specifying object relationships. The underlying objects are persisted to CouchDB and are retreived using CouchDB idioms.
|
18
|
+
|
19
|
+
A few facilities are provided including pretty printing of GET requests and uploading of JavaScript views.
|
20
|
+
|
21
|
+
A basic merb plugin, "merb_relaxdb":http://github.com/paulcarey/merb_relaxdb/tree/master is also available.
|
22
|
+
|
23
|
+
For more complete documentation take a look at docs/spec_results.html and the corresponding specs.
|
24
|
+
|
25
|
+
*Note*: While RelaxDB 0.3 is explicitly compatible with CouchDB 0.9, HEAD typically tracks CouchDB HEAD.
|
26
|
+
|
27
|
+
h2. Details
|
28
|
+
|
29
|
+
h3. Getting started
|
30
|
+
|
31
|
+
<pre>
|
32
|
+
<code>
|
33
|
+
require 'rubygems'
|
34
|
+
require 'relaxdb'
|
35
|
+
|
36
|
+
RelaxDB.configure :host => "localhost", :port => 5984, :design_doc => "app"
|
37
|
+
RelaxDB.use_db "relaxdb_scratch"
|
38
|
+
|
39
|
+
RelaxDB.enable_view_creation # creates views when class definition is executed
|
40
|
+
</code>
|
41
|
+
</pre>
|
42
|
+
|
43
|
+
h3. Defining models
|
44
|
+
|
45
|
+
<pre>
|
46
|
+
<code>
|
47
|
+
|
48
|
+
class User < RelaxDB::Document
|
49
|
+
property :name
|
50
|
+
end
|
51
|
+
|
52
|
+
class Invite < RelaxDB::Document
|
53
|
+
|
54
|
+
property :created_at
|
55
|
+
|
56
|
+
property :event_name
|
57
|
+
|
58
|
+
property :state, :default => "awaiting_response",
|
59
|
+
:validator => lambda { |s| %w(accepted rejected awaiting_response).include? s }
|
60
|
+
|
61
|
+
references :sender, :validator => :required
|
62
|
+
|
63
|
+
references :recipient, :validator => :required
|
64
|
+
|
65
|
+
property :sender_name,
|
66
|
+
:derived => [:sender, lambda { |p, o| o.sender.name } ]
|
67
|
+
|
68
|
+
view_by :sender_name
|
69
|
+
view_by :sender_id
|
70
|
+
view_by :recipient_id, :created_at, :descending => true
|
71
|
+
|
72
|
+
def on_update_conflict
|
73
|
+
puts "conflict!"
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
</code>
|
79
|
+
</pre>
|
80
|
+
|
81
|
+
h3. Exploring models
|
82
|
+
|
83
|
+
<pre>
|
84
|
+
<code>
|
85
|
+
# Saving objects
|
86
|
+
|
87
|
+
sofa = User.new(:name => "sofa").save!
|
88
|
+
futon = User.new(:name => "futon").save!
|
89
|
+
|
90
|
+
i = Invite.new :sender => sofa, :recipient => futon, :event_name => "CouchCamp"
|
91
|
+
i.save!
|
92
|
+
|
93
|
+
# Loading and querying
|
94
|
+
|
95
|
+
il = RelaxDB.load i._id
|
96
|
+
puts i == il # true
|
97
|
+
|
98
|
+
ir = Invite.by_sender_name "sofa"
|
99
|
+
puts i == ir # true
|
100
|
+
|
101
|
+
ix = Invite.by_sender_name(:key => "sofa").first
|
102
|
+
puts i == ix # true
|
103
|
+
|
104
|
+
# Denormalization
|
105
|
+
|
106
|
+
puts ix.sender_name # prints sofa, no requests to CouchDB made
|
107
|
+
puts ix.sender.name # prints sofa, a single CouchDB request made
|
108
|
+
|
109
|
+
# Saving with conflicts
|
110
|
+
|
111
|
+
idup = i.dup
|
112
|
+
i.save!
|
113
|
+
idup.save # conflict printed
|
114
|
+
|
115
|
+
# Saving with and without validations
|
116
|
+
|
117
|
+
i = Invite.new :sender => sofa, :event_name => "CouchCamp"
|
118
|
+
|
119
|
+
i.save! rescue :ok # save! throws an exception on validation failure or conflict
|
120
|
+
i.save # returns false rather than throwing an exception
|
121
|
+
puts i.errors.inspect # prints {:recipient=>"invalid:"}
|
122
|
+
|
123
|
+
i.validation_skip_list << :recipient # Any and all validations may be skipped
|
124
|
+
i.save # succeeds
|
125
|
+
|
126
|
+
</code>
|
127
|
+
</pre>
|
128
|
+
|
129
|
+
h3. Paginating models
|
130
|
+
|
131
|
+
<pre>
|
132
|
+
<code>
|
133
|
+
# Controller
|
134
|
+
|
135
|
+
def show(page_params={})
|
136
|
+
uid = @user._id
|
137
|
+
@invites = Invite.paginate_by_sender_name :startkey => [uid, {}],
|
138
|
+
:endkey => [uid], :descending => true, :limit => 5, :page_params => page_params
|
139
|
+
render
|
140
|
+
end
|
141
|
+
|
142
|
+
# In your view
|
143
|
+
|
144
|
+
<% @invites.each do |i| %>
|
145
|
+
<%= i.event_name %>
|
146
|
+
<% end %>
|
147
|
+
|
148
|
+
<%= link_to "prev", "/invites/?#{@invites.prev_query}" if @invites.prev_query %>
|
149
|
+
<%= link_to "next", "/invites/?#{@invites.next_query}" if @invites.next_query %>
|
150
|
+
</code>
|
151
|
+
</pre>
|
152
|
+
|
153
|
+
More illustrative examples are listed in the .paginate_view spec in spec/paginate_spec.rb
|
154
|
+
|
155
|
+
h3. Creating views by hand
|
156
|
+
|
157
|
+
<pre>
|
158
|
+
<code>
|
159
|
+
$ cat view.js
|
160
|
+
function Invites_by_state-map(doc) {
|
161
|
+
if(doc.relaxdb_class === "Invite")
|
162
|
+
emit(doc.state, doc);
|
163
|
+
}
|
164
|
+
|
165
|
+
function Invites_by_state-reduce(keys, values, rereduce) {
|
166
|
+
if (rereduce) {
|
167
|
+
return sum(values);
|
168
|
+
} else {
|
169
|
+
return values.length;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
$
|
173
|
+
|
174
|
+
RelaxDB::ViewUploader.upload("view.js")
|
175
|
+
RelaxDB.view "Invites_by_state", :key => "accepted", :reduce => true
|
176
|
+
</code>
|
177
|
+
</pre>
|
178
|
+
|
179
|
+
h3. Migrations
|
180
|
+
|
181
|
+
<pre>
|
182
|
+
<code>
|
183
|
+
$ cat 001_double.rb
|
184
|
+
RelaxDB::Migration.run Primitives do |p|
|
185
|
+
p.num *= 2
|
186
|
+
p
|
187
|
+
end
|
188
|
+
|
189
|
+
$ ruby -e 'RelaxDB::Migration.run_all Dir["./*.rb"]'
|
190
|
+
</code>
|
191
|
+
</pre>
|
192
|
+
|
193
|
+
h3. Visualise
|
194
|
+
|
195
|
+
"Fuschia":http://github.com/paulcarey/fuschia/tree/master offers a web front end for visualising inter-document relationships.
|
196
|
+
|
197
|
+
h2. Incomplete list of limitations
|
198
|
+
|
199
|
+
* Destroying an object results in non transactional nullification of child/peer references
|
200
|
+
* Objects can talk to only one database at a time. Similarly for design docs.
|
data/Rakefile
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake/gempackagetask'
|
3
|
+
require 'spec/rake/spectask'
|
4
|
+
|
5
|
+
PLUGIN = "relaxdb"
|
6
|
+
NAME = "relaxdb"
|
7
|
+
GEM_VERSION = "0.3.5"
|
8
|
+
AUTHOR = "Paul Carey"
|
9
|
+
EMAIL = "paul.p.carey@gmail.com"
|
10
|
+
HOMEPAGE = "http://github.com/paulcarey/relaxdb/"
|
11
|
+
SUMMARY = "RelaxDB provides a simple interface to CouchDB"
|
12
|
+
|
13
|
+
spec = Gem::Specification.new do |s|
|
14
|
+
s.name = NAME
|
15
|
+
s.version = GEM_VERSION
|
16
|
+
s.platform = Gem::Platform::RUBY
|
17
|
+
s.has_rdoc = true
|
18
|
+
s.extra_rdoc_files = ["README.textile", "LICENSE"]
|
19
|
+
s.summary = SUMMARY
|
20
|
+
s.description = s.summary
|
21
|
+
s.author = AUTHOR
|
22
|
+
s.email = EMAIL
|
23
|
+
s.homepage = HOMEPAGE
|
24
|
+
|
25
|
+
s.add_dependency "extlib", ">=0.9.4"
|
26
|
+
s.add_dependency "json"
|
27
|
+
s.add_dependency "uuid"
|
28
|
+
|
29
|
+
s.require_path = 'lib'
|
30
|
+
s.autorequire = PLUGIN
|
31
|
+
s.files = %w(LICENSE README.textile readme.rb Rakefile) + Dir.glob("{docs,lib,spec}/**/*")
|
32
|
+
end
|
33
|
+
|
34
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
35
|
+
pkg.gem_spec = spec
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Install"
|
39
|
+
task :install => [:package] do
|
40
|
+
sh %{sudo gem install --local pkg/#{NAME}-#{GEM_VERSION} --no-update-sources}
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Run specs"
|
44
|
+
Spec::Rake::SpecTask.new('spec') do |t|
|
45
|
+
t.spec_files = FileList['spec/**/*.rb']
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "Run specs and produce spec_results.html"
|
49
|
+
Spec::Rake::SpecTask.new('spec:html') do |t|
|
50
|
+
t.spec_files = FileList['spec/**/*.rb']
|
51
|
+
t.spec_opts = ["--format", "html:docs/spec_results.html"]
|
52
|
+
end
|
53
|
+
|
54
|
+
desc "Supports atomic bulk save"
|
55
|
+
task :atomic_bulk_save_support do |t|
|
56
|
+
require 'lib/more/atomic_bulk_save_support.rb'
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "Create base spec db"
|
60
|
+
task :create_base_db do
|
61
|
+
require 'spec/spec_helper'
|
62
|
+
create_base_db
|
63
|
+
end
|
@@ -0,0 +1,1059 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
+
<head>
|
7
|
+
<title>RSpec results</title>
|
8
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
9
|
+
<meta http-equiv="Expires" content="-1" />
|
10
|
+
<meta http-equiv="Pragma" content="no-cache" />
|
11
|
+
<style type="text/css">
|
12
|
+
body {
|
13
|
+
margin: 0;
|
14
|
+
padding: 0;
|
15
|
+
background: #fff;
|
16
|
+
font-size: 80%;
|
17
|
+
}
|
18
|
+
</style>
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
<div class="rspec-report">
|
22
|
+
<script type="text/javascript">
|
23
|
+
// <![CDATA[
|
24
|
+
function moveProgressBar(percentDone) {
|
25
|
+
document.getElementById("rspec-header").style.width = percentDone +"%";
|
26
|
+
}
|
27
|
+
function makeRed(element_id) {
|
28
|
+
document.getElementById(element_id).style.background = '#C40D0D';
|
29
|
+
document.getElementById(element_id).style.color = '#FFFFFF';
|
30
|
+
}
|
31
|
+
|
32
|
+
function makeYellow(element_id) {
|
33
|
+
if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
|
34
|
+
{
|
35
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
36
|
+
document.getElementById(element_id).style.color = '#000000';
|
37
|
+
}
|
38
|
+
else
|
39
|
+
{
|
40
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
41
|
+
document.getElementById(element_id).style.color = '#000000';
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
// ]]>
|
46
|
+
</script>
|
47
|
+
<style type="text/css">
|
48
|
+
#rspec-header {
|
49
|
+
background: #65C400; color: #fff;
|
50
|
+
}
|
51
|
+
|
52
|
+
.rspec-report h1 {
|
53
|
+
margin: 0px 10px 0px 10px;
|
54
|
+
padding: 10px;
|
55
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
56
|
+
font-size: 1.8em;
|
57
|
+
}
|
58
|
+
|
59
|
+
#summary {
|
60
|
+
margin: 0; padding: 5px 10px;
|
61
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
62
|
+
text-align: right;
|
63
|
+
position: absolute;
|
64
|
+
top: 0px;
|
65
|
+
right: 0px;
|
66
|
+
}
|
67
|
+
|
68
|
+
#summary p {
|
69
|
+
margin: 0 0 0 2px;
|
70
|
+
}
|
71
|
+
|
72
|
+
#summary #totals {
|
73
|
+
font-size: 1.2em;
|
74
|
+
}
|
75
|
+
|
76
|
+
.example_group {
|
77
|
+
margin: 0 10px 5px;
|
78
|
+
background: #fff;
|
79
|
+
}
|
80
|
+
|
81
|
+
dl {
|
82
|
+
margin: 0; padding: 0 0 5px;
|
83
|
+
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
84
|
+
}
|
85
|
+
|
86
|
+
dt {
|
87
|
+
padding: 3px;
|
88
|
+
background: #65C400;
|
89
|
+
color: #fff;
|
90
|
+
font-weight: bold;
|
91
|
+
}
|
92
|
+
|
93
|
+
dd {
|
94
|
+
margin: 5px 0 5px 5px;
|
95
|
+
padding: 3px 3px 3px 18px;
|
96
|
+
}
|
97
|
+
|
98
|
+
dd.spec.passed {
|
99
|
+
border-left: 5px solid #65C400;
|
100
|
+
border-bottom: 1px solid #65C400;
|
101
|
+
background: #DBFFB4; color: #3D7700;
|
102
|
+
}
|
103
|
+
|
104
|
+
dd.spec.failed {
|
105
|
+
border-left: 5px solid #C20000;
|
106
|
+
border-bottom: 1px solid #C20000;
|
107
|
+
color: #C20000; background: #FFFBD3;
|
108
|
+
}
|
109
|
+
|
110
|
+
dd.spec.not_implemented {
|
111
|
+
border-left: 5px solid #FAF834;
|
112
|
+
border-bottom: 1px solid #FAF834;
|
113
|
+
background: #FCFB98; color: #131313;
|
114
|
+
}
|
115
|
+
|
116
|
+
dd.spec.pending_fixed {
|
117
|
+
border-left: 5px solid #0000C2;
|
118
|
+
border-bottom: 1px solid #0000C2;
|
119
|
+
color: #0000C2; background: #D3FBFF;
|
120
|
+
}
|
121
|
+
|
122
|
+
.backtrace {
|
123
|
+
color: #000;
|
124
|
+
font-size: 12px;
|
125
|
+
}
|
126
|
+
|
127
|
+
a {
|
128
|
+
color: #BE5C00;
|
129
|
+
}
|
130
|
+
|
131
|
+
/* Ruby code, style similar to vibrant ink */
|
132
|
+
.ruby {
|
133
|
+
font-size: 12px;
|
134
|
+
font-family: monospace;
|
135
|
+
color: white;
|
136
|
+
background-color: black;
|
137
|
+
padding: 0.1em 0 0.2em 0;
|
138
|
+
}
|
139
|
+
|
140
|
+
.ruby .keyword { color: #FF6600; }
|
141
|
+
.ruby .constant { color: #339999; }
|
142
|
+
.ruby .attribute { color: white; }
|
143
|
+
.ruby .global { color: white; }
|
144
|
+
.ruby .module { color: white; }
|
145
|
+
.ruby .class { color: white; }
|
146
|
+
.ruby .string { color: #66FF00; }
|
147
|
+
.ruby .ident { color: white; }
|
148
|
+
.ruby .method { color: #FFCC00; }
|
149
|
+
.ruby .number { color: white; }
|
150
|
+
.ruby .char { color: white; }
|
151
|
+
.ruby .comment { color: #9933CC; }
|
152
|
+
.ruby .symbol { color: white; }
|
153
|
+
.ruby .regex { color: #44B4CC; }
|
154
|
+
.ruby .punct { color: white; }
|
155
|
+
.ruby .escape { color: white; }
|
156
|
+
.ruby .interp { color: white; }
|
157
|
+
.ruby .expr { color: white; }
|
158
|
+
|
159
|
+
.ruby .offending { background-color: gray; }
|
160
|
+
.ruby .linenum {
|
161
|
+
width: 75px;
|
162
|
+
padding: 0.1em 1em 0.2em 0;
|
163
|
+
color: #000000;
|
164
|
+
background-color: #FFFBD3;
|
165
|
+
}
|
166
|
+
|
167
|
+
</style>
|
168
|
+
|
169
|
+
<div id="rspec-header">
|
170
|
+
<h1>RSpec Results</h1>
|
171
|
+
|
172
|
+
<div id="summary">
|
173
|
+
<p id="totals"> </p>
|
174
|
+
<p id="duration"> </p>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div class="results">
|
179
|
+
<div class="example_group">
|
180
|
+
<dl>
|
181
|
+
<dt id="example_group_1">RelaxDB::BelongsToProxy</dt>
|
182
|
+
</dl>
|
183
|
+
</div>
|
184
|
+
<div class="example_group">
|
185
|
+
<dl>
|
186
|
+
<dt id="example_group_2">RelaxDB::BelongsToProxy belongs_to</dt>
|
187
|
+
<script type="text/javascript">moveProgressBar('0.4');</script>
|
188
|
+
<dd class="spec passed"><span class="passed_spec_name">should return nil when accessed before assignment</span></dd>
|
189
|
+
<script type="text/javascript">moveProgressBar('0.9');</script>
|
190
|
+
<dd class="spec passed"><span class="passed_spec_name">should be establishable via constructor attribute</span></dd>
|
191
|
+
<script type="text/javascript">moveProgressBar('1.3');</script>
|
192
|
+
<dd class="spec passed"><span class="passed_spec_name">should be establishable via constructor id</span></dd>
|
193
|
+
<script type="text/javascript">moveProgressBar('1.8');</script>
|
194
|
+
<dd class="spec passed"><span class="passed_spec_name">should establish the parent relationship when supplied a parent and saved</span></dd>
|
195
|
+
<script type="text/javascript">moveProgressBar('2.3');</script>
|
196
|
+
<dd class="spec passed"><span class="passed_spec_name">should establish the parent relationship when supplied a parent id and saved</span></dd>
|
197
|
+
<script type="text/javascript">moveProgressBar('2.7');</script>
|
198
|
+
<dd class="spec passed"><span class="passed_spec_name">should return the same object on repeated invocations</span></dd>
|
199
|
+
<script type="text/javascript">moveProgressBar('3.2');</script>
|
200
|
+
<dd class="spec passed"><span class="passed_spec_name">should be nullified when the parent is destroyed</span></dd>
|
201
|
+
<script type="text/javascript">moveProgressBar('3.7');</script>
|
202
|
+
<dd class="spec passed"><span class="passed_spec_name">should be preserved across save / load boundary</span></dd>
|
203
|
+
<script type="text/javascript">moveProgressBar('4.1');</script>
|
204
|
+
<dd class="spec passed"><span class="passed_spec_name">should be able to reference itself via its parent</span></dd>
|
205
|
+
<script type="text/javascript">moveProgressBar('4.6');</script>
|
206
|
+
<dd class="spec passed"><span class="passed_spec_name">may be used reciprocally</span></dd>
|
207
|
+
</dl>
|
208
|
+
</div>
|
209
|
+
<div class="example_group">
|
210
|
+
<dl>
|
211
|
+
<dt id="example_group_3">RelaxDB::BelongsToProxy belongs_to validator</dt>
|
212
|
+
<script type="text/javascript">moveProgressBar('5.0');</script>
|
213
|
+
<dd class="spec passed"><span class="passed_spec_name">should be passed the _id and object</span></dd>
|
214
|
+
<script type="text/javascript">moveProgressBar('5.5');</script>
|
215
|
+
<dd class="spec passed"><span class="passed_spec_name">may be used with a predefined validator</span></dd>
|
216
|
+
<script type="text/javascript">moveProgressBar('6.0');</script>
|
217
|
+
<dd class="spec passed"><span class="passed_spec_name">should be provided with a default error message when validation fails</span></dd>
|
218
|
+
</dl>
|
219
|
+
</div>
|
220
|
+
<div class="example_group">
|
221
|
+
<dl>
|
222
|
+
<dt id="example_group_4">RelaxDB::Document callbacks</dt>
|
223
|
+
</dl>
|
224
|
+
</div>
|
225
|
+
<div class="example_group">
|
226
|
+
<dl>
|
227
|
+
<dt id="example_group_5">RelaxDB::Document callbacks before_save</dt>
|
228
|
+
<script type="text/javascript">moveProgressBar('6.4');</script>
|
229
|
+
<dd class="spec passed"><span class="passed_spec_name">should be run before the object is saved</span></dd>
|
230
|
+
<script type="text/javascript">moveProgressBar('6.9');</script>
|
231
|
+
<dd class="spec passed"><span class="passed_spec_name">should prevent the object from being saved if it returns false</span></dd>
|
232
|
+
<script type="text/javascript">moveProgressBar('7.4');</script>
|
233
|
+
<dd class="spec passed"><span class="passed_spec_name">should add a description to errors when false is returned</span></dd>
|
234
|
+
<script type="text/javascript">moveProgressBar('7.8');</script>
|
235
|
+
<dd class="spec passed"><span class="passed_spec_name">should not prevent the object from being saved if it returns nil</span></dd>
|
236
|
+
<script type="text/javascript">moveProgressBar('8.3');</script>
|
237
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a proc</span></dd>
|
238
|
+
<script type="text/javascript">moveProgressBar('8.7');</script>
|
239
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a method</span></dd>
|
240
|
+
</dl>
|
241
|
+
</div>
|
242
|
+
<div class="example_group">
|
243
|
+
<dl>
|
244
|
+
<dt id="example_group_6">RelaxDB::Document callbacks after_save</dt>
|
245
|
+
<script type="text/javascript">moveProgressBar('9.2');</script>
|
246
|
+
<dd class="spec passed"><span class="passed_spec_name">should be run after the object is saved</span></dd>
|
247
|
+
</dl>
|
248
|
+
</div>
|
249
|
+
<div class="example_group">
|
250
|
+
<dl>
|
251
|
+
<dt id="example_group_7">RelaxDB::Document derived properties</dt>
|
252
|
+
<script type="text/javascript">moveProgressBar('9.7');</script>
|
253
|
+
<dd class="spec passed"><span class="passed_spec_name">should have its value updated when the source is updated</span></dd>
|
254
|
+
<script type="text/javascript">moveProgressBar('10.1');</script>
|
255
|
+
<dd class="spec passed"><span class="passed_spec_name">should have its value persisted</span></dd>
|
256
|
+
<script type="text/javascript">moveProgressBar('10.6');</script>
|
257
|
+
<dd class="spec passed"><span class="passed_spec_name">should have its value updated when the source_id is updated for a saved event</span></dd>
|
258
|
+
<script type="text/javascript">moveProgressBar('11.1');</script>
|
259
|
+
<dd class="spec passed"><span class="passed_spec_name">will not raise an exception when the source is nil</span></dd>
|
260
|
+
<script type="text/javascript">moveProgressBar('11.5');</script>
|
261
|
+
<dd class="spec passed"><span class="passed_spec_name">should only be updated for registered properties</span></dd>
|
262
|
+
<script type="text/javascript">moveProgressBar('12.0');</script>
|
263
|
+
<dd class="spec passed"><span class="passed_spec_name">should have the existing value passed to the first lambda param</span></dd>
|
264
|
+
<script type="text/javascript">moveProgressBar('12.5');</script>
|
265
|
+
<dd class="spec passed"><span class="passed_spec_name">should contintue to be derived post load</span></dd>
|
266
|
+
</dl>
|
267
|
+
</div>
|
268
|
+
<div class="example_group">
|
269
|
+
<dl>
|
270
|
+
<dt id="example_group_8">RelaxDB::Document derived properties multiple properties</dt>
|
271
|
+
<script type="text/javascript">moveProgressBar('12.9');</script>
|
272
|
+
<dd class="spec passed"><span class="passed_spec_name">should be derivable from the same source</span></dd>
|
273
|
+
</dl>
|
274
|
+
</div>
|
275
|
+
<div class="example_group">
|
276
|
+
<dl>
|
277
|
+
<dt id="example_group_9">RelaxDB::DesignDocument</dt>
|
278
|
+
</dl>
|
279
|
+
</div>
|
280
|
+
<div class="example_group">
|
281
|
+
<dl>
|
282
|
+
<dt id="example_group_10">RelaxDB::DesignDocument#save</dt>
|
283
|
+
<script type="text/javascript">moveProgressBar('13.4');</script>
|
284
|
+
<dd class="spec passed"><span class="passed_spec_name">should create a corresponding document in CouchDB</span></dd>
|
285
|
+
</dl>
|
286
|
+
</div>
|
287
|
+
<div class="example_group">
|
288
|
+
<dl>
|
289
|
+
<dt id="example_group_11">RelaxDB::DesignDocument#destroy</dt>
|
290
|
+
<script type="text/javascript">moveProgressBar('13.8');</script>
|
291
|
+
<dd class="spec passed"><span class="passed_spec_name">should delete the corresponding document from CouchDB</span></dd>
|
292
|
+
</dl>
|
293
|
+
</div>
|
294
|
+
<div class="example_group">
|
295
|
+
<dl>
|
296
|
+
<dt id="example_group_12">Inheritance</dt>
|
297
|
+
</dl>
|
298
|
+
</div>
|
299
|
+
<div class="example_group">
|
300
|
+
<dl>
|
301
|
+
<dt id="example_group_13">Inheritance properties</dt>
|
302
|
+
<script type="text/javascript">moveProgressBar('14.3');</script>
|
303
|
+
<dd class="spec passed"><span class="passed_spec_name">should by inherited from a parent document</span></dd>
|
304
|
+
<script type="text/javascript">moveProgressBar('14.8');</script>
|
305
|
+
<dd class="spec passed"><span class="passed_spec_name">should store its own properties</span></dd>
|
306
|
+
<script type="text/javascript">moveProgressBar('15.2');</script>
|
307
|
+
<dd class="spec passed"><span class="passed_spec_name">validators should behave as normal</span></dd>
|
308
|
+
</dl>
|
309
|
+
</div>
|
310
|
+
<div class="example_group">
|
311
|
+
<dl>
|
312
|
+
<dt id="example_group_14">Inheritance _all views</dt>
|
313
|
+
<script type="text/javascript">moveProgressBar('15.7');</script>
|
314
|
+
<dd class="spec passed"><span class="passed_spec_name">should be rewritten</span></dd>
|
315
|
+
<script type="text/javascript">moveProgressBar('16.2');</script>
|
316
|
+
<dd class="spec passed"><span class="passed_spec_name">should function with inheritance trees</span></dd>
|
317
|
+
</dl>
|
318
|
+
</div>
|
319
|
+
<div class="example_group">
|
320
|
+
<dl>
|
321
|
+
<dt id="example_group_15">Inheritance _by views</dt>
|
322
|
+
<script type="text/javascript">moveProgressBar('16.6');</script>
|
323
|
+
<dd class="spec passed"><span class="passed_spec_name">should be rewritten for ancestors and generated for descendants</span></dd>
|
324
|
+
</dl>
|
325
|
+
</div>
|
326
|
+
<div class="example_group">
|
327
|
+
<dl>
|
328
|
+
<dt id="example_group_16">Inheritance derived properties</dt>
|
329
|
+
<script type="text/javascript">moveProgressBar('17.1');</script>
|
330
|
+
<dd class="spec passed"><span class="passed_spec_name">should be stored</span></dd>
|
331
|
+
</dl>
|
332
|
+
</div>
|
333
|
+
<div class="example_group">
|
334
|
+
<dl>
|
335
|
+
<dt id="example_group_17">Inheritance references</dt>
|
336
|
+
<script type="text/javascript">moveProgressBar('17.5');</script>
|
337
|
+
<dd class="spec passed"><span class="passed_spec_name">should function as normal</span></dd>
|
338
|
+
</dl>
|
339
|
+
</div>
|
340
|
+
<div class="example_group">
|
341
|
+
<dl>
|
342
|
+
<dt id="example_group_18">RelaxDB::Document</dt>
|
343
|
+
</dl>
|
344
|
+
</div>
|
345
|
+
<div class="example_group">
|
346
|
+
<dl>
|
347
|
+
<dt id="example_group_19">RelaxDB::Document.new</dt>
|
348
|
+
<script type="text/javascript">moveProgressBar('18.0');</script>
|
349
|
+
<dd class="spec passed"><span class="passed_spec_name">should create an object with an id</span></dd>
|
350
|
+
<script type="text/javascript">moveProgressBar('18.5');</script>
|
351
|
+
<dd class="spec passed"><span class="passed_spec_name">should create an object with a nil revision</span></dd>
|
352
|
+
<script type="text/javascript">moveProgressBar('18.9');</script>
|
353
|
+
<dd class="spec passed"><span class="passed_spec_name">should convert attributes that end in _at to Times</span></dd>
|
354
|
+
<script type="text/javascript">moveProgressBar('19.4');</script>
|
355
|
+
<dd class="spec passed"><span class="passed_spec_name">will silently ignore parameters that don't specify class attributes</span></dd>
|
356
|
+
<script type="text/javascript">moveProgressBar('19.9');</script>
|
357
|
+
<dd class="spec passed"><span class="passed_spec_name">should create a document with a non conflicing state</span></dd>
|
358
|
+
</dl>
|
359
|
+
</div>
|
360
|
+
<div class="example_group">
|
361
|
+
<dl>
|
362
|
+
<dt id="example_group_20">RelaxDB::Document#initialize</dt>
|
363
|
+
<script type="text/javascript">moveProgressBar('20.3');</script>
|
364
|
+
<dd class="spec passed"><span class="passed_spec_name">may be overridden by inheriting classes</span></dd>
|
365
|
+
</dl>
|
366
|
+
</div>
|
367
|
+
<div class="example_group">
|
368
|
+
<dl>
|
369
|
+
<dt id="example_group_21">RelaxDB::Document#to_json</dt>
|
370
|
+
<script type="text/javascript">moveProgressBar('20.8');</script>
|
371
|
+
<dd class="spec passed"><span class="passed_spec_name">should not output nil attributes</span></dd>
|
372
|
+
<script type="text/javascript">moveProgressBar('21.2');</script>
|
373
|
+
<dd class="spec passed"><span class="passed_spec_name">should convert times to '%Y/%m/%d %H:%M:%S +0000' format</span></dd>
|
374
|
+
</dl>
|
375
|
+
</div>
|
376
|
+
<div class="example_group">
|
377
|
+
<dl>
|
378
|
+
<dt id="example_group_22">RelaxDB::Document#save</dt>
|
379
|
+
<script type="text/javascript">moveProgressBar('21.7');</script>
|
380
|
+
<dd class="spec passed"><span class="passed_spec_name">should set an object's revision</span></dd>
|
381
|
+
<script type="text/javascript">moveProgressBar('22.2');</script>
|
382
|
+
<dd class="spec passed"><span class="passed_spec_name">should result in an object considered saved</span></dd>
|
383
|
+
<script type="text/javascript">moveProgressBar('22.6');</script>
|
384
|
+
<dd class="spec passed"><span class="passed_spec_name">should be invokable multiple times</span></dd>
|
385
|
+
<script type="text/javascript">moveProgressBar('23.1');</script>
|
386
|
+
<dd class="spec passed"><span class="passed_spec_name">should set created_at when first saved</span></dd>
|
387
|
+
<script type="text/javascript">moveProgressBar('23.6');</script>
|
388
|
+
<dd class="spec passed"><span class="passed_spec_name">should set created_at when first saved unless supplied to the constructor</span></dd>
|
389
|
+
<script type="text/javascript">moveProgressBar('24.0');</script>
|
390
|
+
<dd class="spec passed"><span class="passed_spec_name">should set document conflict state on conflicting save</span></dd>
|
391
|
+
</dl>
|
392
|
+
</div>
|
393
|
+
<div class="example_group">
|
394
|
+
<dl>
|
395
|
+
<dt id="example_group_23">RelaxDB::Document#save!</dt>
|
396
|
+
<script type="text/javascript">moveProgressBar('24.5');</script>
|
397
|
+
<dd class="spec passed"><span class="passed_spec_name">should save objects</span></dd>
|
398
|
+
<script type="text/javascript">moveProgressBar('25.0');</script>
|
399
|
+
<dd class="spec passed"><span class="passed_spec_name">should raise ValidationFailure on validation failure</span></dd>
|
400
|
+
<script type="text/javascript">moveProgressBar('25.4');</script>
|
401
|
+
<dd class="spec passed"><span class="passed_spec_name">should raise UpdateConflict on an update conflict</span></dd>
|
402
|
+
</dl>
|
403
|
+
</div>
|
404
|
+
<div class="example_group">
|
405
|
+
<dl>
|
406
|
+
<dt id="example_group_24">RelaxDB::Document user defined property reader</dt>
|
407
|
+
<script type="text/javascript">moveProgressBar('25.9');</script>
|
408
|
+
<dd class="spec passed"><span class="passed_spec_name">should not effect normal operation</span></dd>
|
409
|
+
<script type="text/javascript">moveProgressBar('26.3');</script>
|
410
|
+
<dd class="spec passed"><span class="passed_spec_name">should not modify internal state</span></dd>
|
411
|
+
</dl>
|
412
|
+
</div>
|
413
|
+
<div class="example_group">
|
414
|
+
<dl>
|
415
|
+
<dt id="example_group_25">RelaxDB::Document user defined property writer</dt>
|
416
|
+
<script type="text/javascript">moveProgressBar('26.8');</script>
|
417
|
+
<dd class="spec passed"><span class="passed_spec_name">should not be used</span></dd>
|
418
|
+
</dl>
|
419
|
+
</div>
|
420
|
+
<div class="example_group">
|
421
|
+
<dl>
|
422
|
+
<dt id="example_group_26">RelaxDB::Document loaded objects</dt>
|
423
|
+
<script type="text/javascript">moveProgressBar('27.3');</script>
|
424
|
+
<dd class="spec passed"><span class="passed_spec_name">should contain state as when saved</span></dd>
|
425
|
+
<script type="text/javascript">moveProgressBar('27.7');</script>
|
426
|
+
<dd class="spec passed"><span class="passed_spec_name">should be saveable</span></dd>
|
427
|
+
</dl>
|
428
|
+
</div>
|
429
|
+
<div class="example_group">
|
430
|
+
<dl>
|
431
|
+
<dt id="example_group_27">RelaxDB::Document#destroy</dt>
|
432
|
+
<script type="text/javascript">moveProgressBar('28.2');</script>
|
433
|
+
<dd class="spec passed"><span class="passed_spec_name">should delete the corresponding document from CouchDB</span></dd>
|
434
|
+
<script type="text/javascript">makeRed('rspec-header');</script>
|
435
|
+
<script type="text/javascript">makeRed('example_group_27');</script>
|
436
|
+
<script type="text/javascript">moveProgressBar('28.7');</script>
|
437
|
+
<dd class="spec failed">
|
438
|
+
<span class="failed_spec_name">should prevent the object from being resaved</span>
|
439
|
+
<div class="failure" id="failure_1">
|
440
|
+
<div class="message"><pre>expected Exception but nothing was raised</pre></div>
|
441
|
+
<div class="backtrace"><pre>./spec/document_spec.rb:189:</pre></div>
|
442
|
+
<pre class="ruby"><code><span class="linenum">187</span> <span class="ident">p</span> <span class="punct">=</span> <span class="constant">Atom</span><span class="punct">.</span><span class="ident">new</span><span class="punct">.</span><span class="ident">save</span><span class="punct">.</span><span class="ident">destroy!</span>
|
443
|
+
<span class="linenum">188</span> <span class="comment"># Exepcted failure - see http://issues.apache.org/jira/browse/COUCHDB-292 </span>
|
444
|
+
<span class="offending"><span class="linenum">189</span> <span class="ident">lambda</span> <span class="punct">{</span> <span class="ident">p</span><span class="punct">.</span><span class="ident">save!</span> <span class="punct">}.</span><span class="ident">should</span> <span class="ident">raise_error</span></span>
|
445
|
+
<span class="linenum">190</span> <span class="keyword">end</span>
|
446
|
+
<span class="linenum">191</span> </code></pre>
|
447
|
+
</div>
|
448
|
+
</dd>
|
449
|
+
<script type="text/javascript">moveProgressBar('29.1');</script>
|
450
|
+
<dd class="spec passed"><span class="passed_spec_name">will result in undefined behaviour when invoked on unsaved objects</span></dd>
|
451
|
+
</dl>
|
452
|
+
</div>
|
453
|
+
<div class="example_group">
|
454
|
+
<dl>
|
455
|
+
<dt id="example_group_28">RelaxDB::Document#all.destroy!</dt>
|
456
|
+
<script type="text/javascript">moveProgressBar('29.6');</script>
|
457
|
+
<dd class="spec passed"><span class="passed_spec_name">should delete from CouchDB all documents of the corresponding class</span></dd>
|
458
|
+
</dl>
|
459
|
+
</div>
|
460
|
+
<div class="example_group">
|
461
|
+
<dl>
|
462
|
+
<dt id="example_group_29">RelaxDB::Document ==</dt>
|
463
|
+
<script type="text/javascript">moveProgressBar('30.0');</script>
|
464
|
+
<dd class="spec passed"><span class="passed_spec_name">should define equality based on CouchDB id</span></dd>
|
465
|
+
<script type="text/javascript">moveProgressBar('30.5');</script>
|
466
|
+
<dd class="spec passed"><span class="passed_spec_name">should return false when passed a nil object</span></dd>
|
467
|
+
</dl>
|
468
|
+
</div>
|
469
|
+
<div class="example_group">
|
470
|
+
<dl>
|
471
|
+
<dt id="example_group_30">RelaxDB::Document.all</dt>
|
472
|
+
<script type="text/javascript">moveProgressBar('31.0');</script>
|
473
|
+
<dd class="spec passed"><span class="passed_spec_name">should return all instances of that class</span></dd>
|
474
|
+
<script type="text/javascript">moveProgressBar('31.4');</script>
|
475
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an empty array when no instances exist</span></dd>
|
476
|
+
</dl>
|
477
|
+
</div>
|
478
|
+
<div class="example_group">
|
479
|
+
<dl>
|
480
|
+
<dt id="example_group_31">RelaxDB::Document.all.size</dt>
|
481
|
+
<script type="text/javascript">moveProgressBar('31.9');</script>
|
482
|
+
<dd class="spec passed"><span class="passed_spec_name">should return the total number of docs in a single query</span></dd>
|
483
|
+
<script type="text/javascript">moveProgressBar('32.4');</script>
|
484
|
+
<dd class="spec passed"><span class="passed_spec_name">should return 0 when no docs exist</span></dd>
|
485
|
+
</dl>
|
486
|
+
</div>
|
487
|
+
<div class="example_group">
|
488
|
+
<dl>
|
489
|
+
<dt id="example_group_32">RelaxDB::Document by_</dt>
|
490
|
+
<script type="text/javascript">moveProgressBar('32.8');</script>
|
491
|
+
<dd class="spec passed"><span class="passed_spec_name">should sort ascending by default</span></dd>
|
492
|
+
<script type="text/javascript">moveProgressBar('33.3');</script>
|
493
|
+
<dd class="spec passed"><span class="passed_spec_name">should sort desc when specified</span></dd>
|
494
|
+
<script type="text/javascript">moveProgressBar('33.7');</script>
|
495
|
+
<dd class="spec passed"><span class="passed_spec_name">should sort date attributes lexicographically</span></dd>
|
496
|
+
<script type="text/javascript">moveProgressBar('34.2');</script>
|
497
|
+
<dd class="spec passed"><span class="passed_spec_name">should return the count when queried with reduce=true</span></dd>
|
498
|
+
</dl>
|
499
|
+
</div>
|
500
|
+
<div class="example_group">
|
501
|
+
<dl>
|
502
|
+
<dt id="example_group_33">RelaxDB::Document by_ results</dt>
|
503
|
+
<script type="text/javascript">moveProgressBar('34.7');</script>
|
504
|
+
<dd class="spec passed"><span class="passed_spec_name">should be an empty array when no docs match</span></dd>
|
505
|
+
<script type="text/javascript">moveProgressBar('35.1');</script>
|
506
|
+
<dd class="spec passed"><span class="passed_spec_name">should be retrievable by exact criteria</span></dd>
|
507
|
+
<script type="text/javascript">moveProgressBar('35.6');</script>
|
508
|
+
<dd class="spec passed"><span class="passed_spec_name">should be retrievable by relative criteria</span></dd>
|
509
|
+
<script type="text/javascript">moveProgressBar('36.1');</script>
|
510
|
+
<dd class="spec passed"><span class="passed_spec_name">should be retrievable by combined criteria</span></dd>
|
511
|
+
<script type="text/javascript">moveProgressBar('36.5');</script>
|
512
|
+
<dd class="spec passed"><span class="passed_spec_name">should be retrievable by combined criteria where not all docs contain all attributes</span></dd>
|
513
|
+
<script type="text/javascript">moveProgressBar('37.0');</script>
|
514
|
+
<dd class="spec passed"><span class="passed_spec_name">should be retrievable by a multi key post</span></dd>
|
515
|
+
</dl>
|
516
|
+
</div>
|
517
|
+
<div class="example_group">
|
518
|
+
<dl>
|
519
|
+
<dt id="example_group_34">RelaxDB::Document defaults</dt>
|
520
|
+
<script type="text/javascript">moveProgressBar('37.5');</script>
|
521
|
+
<dd class="spec passed"><span class="passed_spec_name">should be set on initialisation</span></dd>
|
522
|
+
<script type="text/javascript">moveProgressBar('37.9');</script>
|
523
|
+
<dd class="spec passed"><span class="passed_spec_name">should be saved</span></dd>
|
524
|
+
<script type="text/javascript">moveProgressBar('38.4');</script>
|
525
|
+
<dd class="spec passed"><span class="passed_spec_name">should be ignored once overwritten</span></dd>
|
526
|
+
<script type="text/javascript">moveProgressBar('38.8');</script>
|
527
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a simple value</span></dd>
|
528
|
+
<script type="text/javascript">moveProgressBar('39.3');</script>
|
529
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a proc</span></dd>
|
530
|
+
</dl>
|
531
|
+
</div>
|
532
|
+
<div class="example_group">
|
533
|
+
<dl>
|
534
|
+
<dt id="example_group_35">RelaxDB::Document validator</dt>
|
535
|
+
<script type="text/javascript">moveProgressBar('39.8');</script>
|
536
|
+
<dd class="spec passed"><span class="passed_spec_name">should prevent an object from being saved if it evaluates to false</span></dd>
|
537
|
+
<script type="text/javascript">moveProgressBar('40.2');</script>
|
538
|
+
<dd class="spec passed"><span class="passed_spec_name">should prevent an object from being saved if it throws an exception</span></dd>
|
539
|
+
<script type="text/javascript">moveProgressBar('40.7');</script>
|
540
|
+
<dd class="spec passed"><span class="passed_spec_name">should pass the property value to the validator</span></dd>
|
541
|
+
<script type="text/javascript">moveProgressBar('41.2');</script>
|
542
|
+
<dd class="spec passed"><span class="passed_spec_name">should pass the property value and object to the validator</span></dd>
|
543
|
+
<script type="text/javascript">moveProgressBar('41.6');</script>
|
544
|
+
<dd class="spec passed"><span class="passed_spec_name">should perform all validations</span></dd>
|
545
|
+
<script type="text/javascript">moveProgressBar('42.1');</script>
|
546
|
+
<dd class="spec passed"><span class="passed_spec_name">should prevent saving unless all validations pass</span></dd>
|
547
|
+
<script type="text/javascript">moveProgressBar('42.5');</script>
|
548
|
+
<dd class="spec passed"><span class="passed_spec_name">should add a default error message if none is specified</span></dd>
|
549
|
+
<script type="text/javascript">moveProgressBar('43.0');</script>
|
550
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a proc</span></dd>
|
551
|
+
<script type="text/javascript">moveProgressBar('43.5');</script>
|
552
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a method</span></dd>
|
553
|
+
<script type="text/javascript">moveProgressBar('43.9');</script>
|
554
|
+
<dd class="spec passed"><span class="passed_spec_name">may be skipped by passing the property symbol to save</span></dd>
|
555
|
+
</dl>
|
556
|
+
</div>
|
557
|
+
<div class="example_group">
|
558
|
+
<dl>
|
559
|
+
<dt id="example_group_36">RelaxDB::Document validation message</dt>
|
560
|
+
<script type="text/javascript">moveProgressBar('44.4');</script>
|
561
|
+
<dd class="spec passed"><span class="passed_spec_name">should be set on failure</span></dd>
|
562
|
+
<script type="text/javascript">moveProgressBar('44.9');</script>
|
563
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a proc accepting the prop only</span></dd>
|
564
|
+
<script type="text/javascript">moveProgressBar('45.3');</script>
|
565
|
+
<dd class="spec passed"><span class="passed_spec_name">may be a proc accepting the prop and object</span></dd>
|
566
|
+
</dl>
|
567
|
+
</div>
|
568
|
+
<div class="example_group">
|
569
|
+
<dl>
|
570
|
+
<dt id="example_group_37">RelaxDB::Document predefined validator</dt>
|
571
|
+
<script type="text/javascript">moveProgressBar('45.8');</script>
|
572
|
+
<dd class="spec passed"><span class="passed_spec_name">should be invoked when a symbol clash exists</span></dd>
|
573
|
+
<script type="text/javascript">moveProgressBar('46.2');</script>
|
574
|
+
<dd class="spec passed"><span class="passed_spec_name">should prevent an object from being saved if validation fails</span></dd>
|
575
|
+
</dl>
|
576
|
+
</div>
|
577
|
+
<div class="example_group">
|
578
|
+
<dl>
|
579
|
+
<dt id="example_group_38">RelaxDB::HasManyProxy</dt>
|
580
|
+
</dl>
|
581
|
+
</div>
|
582
|
+
<div class="example_group">
|
583
|
+
<dl>
|
584
|
+
<dt id="example_group_39">RelaxDB::HasManyProxy has_many</dt>
|
585
|
+
<script type="text/javascript">moveProgressBar('46.7');</script>
|
586
|
+
<dd class="spec passed"><span class="passed_spec_name">should be considered enumerable</span></dd>
|
587
|
+
<script type="text/javascript">moveProgressBar('47.2');</script>
|
588
|
+
<dd class="spec passed"><span class="passed_spec_name">should actually be enumerable</span></dd>
|
589
|
+
<script type="text/javascript">moveProgressBar('47.6');</script>
|
590
|
+
<dd class="spec passed"><span class="passed_spec_name">should preserve the collection across the load / save boundary</span></dd>
|
591
|
+
<script type="text/javascript">moveProgressBar('48.1');</script>
|
592
|
+
<dd class="spec passed"><span class="passed_spec_name">should work with MultiWordClassNames</span></dd>
|
593
|
+
</dl>
|
594
|
+
</div>
|
595
|
+
<div class="example_group">
|
596
|
+
<dl>
|
597
|
+
<dt id="example_group_40">RelaxDB::HasManyProxy has_many#<<</dt>
|
598
|
+
<script type="text/javascript">moveProgressBar('48.6');</script>
|
599
|
+
<dd class="spec passed"><span class="passed_spec_name">should link the added item to the parent</span></dd>
|
600
|
+
<script type="text/javascript">moveProgressBar('49.0');</script>
|
601
|
+
<dd class="spec passed"><span class="passed_spec_name">should return self</span></dd>
|
602
|
+
<script type="text/javascript">moveProgressBar('49.5');</script>
|
603
|
+
<dd class="spec passed"><span class="passed_spec_name">should not created duplicates when invoked with same object more than once</span></dd>
|
604
|
+
<script type="text/javascript">moveProgressBar('50.0');</script>
|
605
|
+
<dd class="spec passed"><span class="passed_spec_name">should return false when the child fails validation</span></dd>
|
606
|
+
</dl>
|
607
|
+
</div>
|
608
|
+
<div class="example_group">
|
609
|
+
<dl>
|
610
|
+
<dt id="example_group_41">RelaxDB::HasManyProxy has_many#=</dt>
|
611
|
+
<script type="text/javascript">moveProgressBar('50.4');</script>
|
612
|
+
<dd class="spec passed"><span class="passed_spec_name">should not attempt to save the child objects when the relationship is established</span></dd>
|
613
|
+
<script type="text/javascript">moveProgressBar('50.9');</script>
|
614
|
+
<dd class="spec passed"><span class="passed_spec_name">should preserve given relationships across save/load boundary</span></dd>
|
615
|
+
<script type="text/javascript">moveProgressBar('51.3');</script>
|
616
|
+
<dd class="spec passed"><span class="passed_spec_name">should invoke the derived properties writer</span></dd>
|
617
|
+
</dl>
|
618
|
+
</div>
|
619
|
+
<div class="example_group">
|
620
|
+
<dl>
|
621
|
+
<dt id="example_group_42">RelaxDB::HasManyProxy has_many#delete</dt>
|
622
|
+
<script type="text/javascript">moveProgressBar('51.8');</script>
|
623
|
+
<dd class="spec passed"><span class="passed_spec_name">should nullify the belongs_to relationship</span></dd>
|
624
|
+
</dl>
|
625
|
+
</div>
|
626
|
+
<div class="example_group">
|
627
|
+
<dl>
|
628
|
+
<dt id="example_group_43">RelaxDB::HasManyProxy has_many#clear</dt>
|
629
|
+
<script type="text/javascript">moveProgressBar('52.3');</script>
|
630
|
+
<dd class="spec passed"><span class="passed_spec_name">should result in an empty collection</span></dd>
|
631
|
+
<script type="text/javascript">moveProgressBar('52.7');</script>
|
632
|
+
<dd class="spec passed"><span class="passed_spec_name">should nullify all child relationships</span></dd>
|
633
|
+
</dl>
|
634
|
+
</div>
|
635
|
+
<div class="example_group">
|
636
|
+
<dl>
|
637
|
+
<dt id="example_group_44">RelaxDB::HasManyProxy has_many owner</dt>
|
638
|
+
<script type="text/javascript">moveProgressBar('53.2');</script>
|
639
|
+
<dd class="spec passed"><span class="passed_spec_name">should be able to form multiple relationships with the same class of child</span></dd>
|
640
|
+
</dl>
|
641
|
+
</div>
|
642
|
+
<div class="example_group">
|
643
|
+
<dl>
|
644
|
+
<dt id="example_group_45">RelaxDB::HasManyProxy has_many owner#destroy</dt>
|
645
|
+
<script type="text/javascript">moveProgressBar('53.7');</script>
|
646
|
+
<dd class="spec passed"><span class="passed_spec_name">should nullify its child relationships</span></dd>
|
647
|
+
</dl>
|
648
|
+
</div>
|
649
|
+
<div class="example_group">
|
650
|
+
<dl>
|
651
|
+
<dt id="example_group_46">RelaxDB::HasOneProxy</dt>
|
652
|
+
</dl>
|
653
|
+
</div>
|
654
|
+
<div class="example_group">
|
655
|
+
<dl>
|
656
|
+
<dt id="example_group_47">RelaxDB::HasOneProxy has_one</dt>
|
657
|
+
<script type="text/javascript">moveProgressBar('54.1');</script>
|
658
|
+
<dd class="spec passed"><span class="passed_spec_name">should return nil when accessed before assignment</span></dd>
|
659
|
+
<script type="text/javascript">moveProgressBar('54.6');</script>
|
660
|
+
<dd class="spec passed"><span class="passed_spec_name">should be establishable via a constructor attribute</span></dd>
|
661
|
+
<script type="text/javascript">moveProgressBar('55.0');</script>
|
662
|
+
<dd class="spec passed"><span class="passed_spec_name">should be establishable via assignment</span></dd>
|
663
|
+
<script type="text/javascript">moveProgressBar('55.5');</script>
|
664
|
+
<dd class="spec passed"><span class="passed_spec_name">should return the same object on repeated invocations</span></dd>
|
665
|
+
<script type="text/javascript">moveProgressBar('56.0');</script>
|
666
|
+
<dd class="spec passed"><span class="passed_spec_name">should be preserved across load / save boundary</span></dd>
|
667
|
+
<script type="text/javascript">moveProgressBar('56.4');</script>
|
668
|
+
<dd class="spec passed"><span class="passed_spec_name">should be able reference itself via its child</span></dd>
|
669
|
+
<script type="text/javascript">moveProgressBar('56.9');</script>
|
670
|
+
<dd class="spec passed"><span class="passed_spec_name">should work with MultiWordClassNames</span></dd>
|
671
|
+
</dl>
|
672
|
+
</div>
|
673
|
+
<div class="example_group">
|
674
|
+
<dl>
|
675
|
+
<dt id="example_group_48">RelaxDB::HasOneProxy has_one#=</dt>
|
676
|
+
<script type="text/javascript">moveProgressBar('57.4');</script>
|
677
|
+
<dd class="spec passed"><span class="passed_spec_name">should create a reference from the child to the parent</span></dd>
|
678
|
+
<script type="text/javascript">moveProgressBar('57.8');</script>
|
679
|
+
<dd class="spec passed"><span class="passed_spec_name">should save the assigned object</span></dd>
|
680
|
+
<script type="text/javascript">moveProgressBar('58.3');</script>
|
681
|
+
<dd class="spec passed"><span class="passed_spec_name">will not save the parent</span></dd>
|
682
|
+
<script type="text/javascript">moveProgressBar('58.7');</script>
|
683
|
+
<dd class="spec passed"><span class="passed_spec_name">should set the target to nil when nil is assigned</span></dd>
|
684
|
+
<script type="text/javascript">moveProgressBar('59.2');</script>
|
685
|
+
<dd class="spec passed"><span class="passed_spec_name">should nullify any existing relationship in the database</span></dd>
|
686
|
+
<script type="text/javascript">moveProgressBar('59.7');</script>
|
687
|
+
<dd class="spec passed"><span class="passed_spec_name">should nullify any existing relationship on a known in-memory object</span></dd>
|
688
|
+
<script type="text/javascript">moveProgressBar('60.1');</script>
|
689
|
+
<dd class="spec passed"><span class="passed_spec_name">will not nullify any existing relationship on unknown in-memory objects</span></dd>
|
690
|
+
<script type="text/javascript">moveProgressBar('60.6');</script>
|
691
|
+
<dd class="spec passed"><span class="passed_spec_name">will not throw an error when the rhs fails validation</span></dd>
|
692
|
+
</dl>
|
693
|
+
</div>
|
694
|
+
<div class="example_group">
|
695
|
+
<dl>
|
696
|
+
<dt id="example_group_49">RelaxDB::PaginateParams</dt>
|
697
|
+
<script type="text/javascript">moveProgressBar('61.1');</script>
|
698
|
+
<dd class="spec passed"><span class="passed_spec_name">should be invalid if hasn't been initialized with both a startkey and endkey</span></dd>
|
699
|
+
<script type="text/javascript">moveProgressBar('61.5');</script>
|
700
|
+
<dd class="spec passed"><span class="passed_spec_name">should be valid if initialized with both a startkey and endkey</span></dd>
|
701
|
+
</dl>
|
702
|
+
</div>
|
703
|
+
<div class="example_group">
|
704
|
+
<dl>
|
705
|
+
<dt id="example_group_50">RelaxDB Pagination</dt>
|
706
|
+
</dl>
|
707
|
+
</div>
|
708
|
+
<div class="example_group">
|
709
|
+
<dl>
|
710
|
+
<dt id="example_group_51">RelaxDB Pagination functional tests</dt>
|
711
|
+
<script type="text/javascript">moveProgressBar('62.0');</script>
|
712
|
+
<dd class="spec passed"><span class="passed_spec_name">should navigate through a series</span></dd>
|
713
|
+
<script type="text/javascript">moveProgressBar('62.5');</script>
|
714
|
+
<dd class="spec passed"><span class="passed_spec_name">should navigate through b series with descending false</span></dd>
|
715
|
+
<script type="text/javascript">moveProgressBar('62.9');</script>
|
716
|
+
<dd class="spec passed"><span class="passed_spec_name">should navigate through b series with descending true</span></dd>
|
717
|
+
<script type="text/javascript">moveProgressBar('63.4');</script>
|
718
|
+
<dd class="spec passed"><span class="passed_spec_name">should not display pagination options for c series</span></dd>
|
719
|
+
</dl>
|
720
|
+
</div>
|
721
|
+
<div class="example_group">
|
722
|
+
<dl>
|
723
|
+
<dt id="example_group_52">RelaxDB Pagination next_query</dt>
|
724
|
+
<script type="text/javascript">moveProgressBar('63.8');</script>
|
725
|
+
<dd class="spec passed"><span class="passed_spec_name">should emit a url encoded and json encoded string with query name page_params</span></dd>
|
726
|
+
<script type="text/javascript">moveProgressBar('64.3');</script>
|
727
|
+
<dd class="spec passed"><span class="passed_spec_name">should be treated as next_param by the paginator</span></dd>
|
728
|
+
</dl>
|
729
|
+
</div>
|
730
|
+
<div class="example_group">
|
731
|
+
<dl>
|
732
|
+
<dt id="example_group_53">RelaxDB Pagination prev_query</dt>
|
733
|
+
<script type="text/javascript">moveProgressBar('64.8');</script>
|
734
|
+
<dd class="spec passed"><span class="passed_spec_name">should be treated as prev_query by the paginator</span></dd>
|
735
|
+
<script type="text/javascript">moveProgressBar('65.2');</script>
|
736
|
+
<dd class="spec passed"><span class="passed_spec_name">should emit a url encoded and json encoded string with query name page_params</span></dd>
|
737
|
+
</dl>
|
738
|
+
</div>
|
739
|
+
<div class="example_group">
|
740
|
+
<dl>
|
741
|
+
<dt id="example_group_54">RelaxDB Pagination multiple keys per document, simple (non array) keys</dt>
|
742
|
+
<script type="text/javascript">moveProgressBar('65.7');</script>
|
743
|
+
<dd class="spec passed"><span class="passed_spec_name">should work when descending is false</span></dd>
|
744
|
+
<script type="text/javascript">moveProgressBar('66.2');</script>
|
745
|
+
<dd class="spec passed"><span class="passed_spec_name">should work when descending is true</span></dd>
|
746
|
+
<script type="text/javascript">moveProgressBar('66.6');</script>
|
747
|
+
<dd class="spec passed"><span class="passed_spec_name">should not get stuck when the number of keys exceeds the limit</span></dd>
|
748
|
+
</dl>
|
749
|
+
</div>
|
750
|
+
<div class="example_group">
|
751
|
+
<dl>
|
752
|
+
<dt id="example_group_55">RelaxDB Pagination.paginate_by</dt>
|
753
|
+
<script type="text/javascript">moveProgressBar('67.1');</script>
|
754
|
+
<dd class="spec passed"><span class="passed_spec_name">should throw an error unless both startkey and endkey are specified</span></dd>
|
755
|
+
<script type="text/javascript">moveProgressBar('67.5');</script>
|
756
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an empty array when no documents exist</span></dd>
|
757
|
+
<script type="text/javascript">moveProgressBar('68.0');</script>
|
758
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an array that responds negatively to next_query and prev_query when no documents exist</span></dd>
|
759
|
+
</dl>
|
760
|
+
</div>
|
761
|
+
<div class="example_group">
|
762
|
+
<dl>
|
763
|
+
<dt id="example_group_56">RelaxDB Pagination.paginate_view functional tests</dt>
|
764
|
+
<script type="text/javascript">moveProgressBar('68.5');</script>
|
765
|
+
<dd class="spec passed"><span class="passed_spec_name">should pass</span></dd>
|
766
|
+
</dl>
|
767
|
+
</div>
|
768
|
+
<div class="example_group">
|
769
|
+
<dl>
|
770
|
+
<dt id="example_group_57">RelaxDB::Query</dt>
|
771
|
+
</dl>
|
772
|
+
</div>
|
773
|
+
<div class="example_group">
|
774
|
+
<dl>
|
775
|
+
<dt id="example_group_58">RelaxDB::Query#view_name</dt>
|
776
|
+
<script type="text/javascript">moveProgressBar('68.9');</script>
|
777
|
+
<dd class="spec passed"><span class="passed_spec_name">should match a single key attribute</span></dd>
|
778
|
+
<script type="text/javascript">moveProgressBar('69.4');</script>
|
779
|
+
<dd class="spec passed"><span class="passed_spec_name">should match key attributes</span></dd>
|
780
|
+
</dl>
|
781
|
+
</div>
|
782
|
+
<div class="example_group">
|
783
|
+
<dl>
|
784
|
+
<dt id="example_group_59">RelaxDB::Query#view_path</dt>
|
785
|
+
<script type="text/javascript">moveProgressBar('69.9');</script>
|
786
|
+
<dd class="spec passed"><span class="passed_spec_name">should list design document and view name and default reduce to false</span></dd>
|
787
|
+
<script type="text/javascript">moveProgressBar('70.3');</script>
|
788
|
+
<dd class="spec passed"><span class="passed_spec_name">should contain URL and JSON encoded key when the key has been set</span></dd>
|
789
|
+
<script type="text/javascript">moveProgressBar('70.8');</script>
|
790
|
+
<dd class="spec passed"><span class="passed_spec_name">should honour startkey, endkey and limit</span></dd>
|
791
|
+
<script type="text/javascript">moveProgressBar('71.2');</script>
|
792
|
+
<dd class="spec passed"><span class="passed_spec_name">should specify a null key if key was set to nil</span></dd>
|
793
|
+
<script type="text/javascript">moveProgressBar('71.7');</script>
|
794
|
+
<dd class="spec passed"><span class="passed_spec_name">should specify a null startkey if startkey was set to nil</span></dd>
|
795
|
+
<script type="text/javascript">moveProgressBar('72.2');</script>
|
796
|
+
<dd class="spec passed"><span class="passed_spec_name">should specify a null endkey if endkey was set to nil</span></dd>
|
797
|
+
<script type="text/javascript">moveProgressBar('72.6');</script>
|
798
|
+
<dd class="spec passed"><span class="passed_spec_name">should not JSON encode the startkey_docid</span></dd>
|
799
|
+
<script type="text/javascript">moveProgressBar('73.1');</script>
|
800
|
+
<dd class="spec passed"><span class="passed_spec_name">should not JSON encode the endkey_docid</span></dd>
|
801
|
+
</dl>
|
802
|
+
</div>
|
803
|
+
<div class="example_group">
|
804
|
+
<dl>
|
805
|
+
<dt id="example_group_60">RelaxDB::Query#keys</dt>
|
806
|
+
<script type="text/javascript">moveProgressBar('73.6');</script>
|
807
|
+
<dd class="spec passed"><span class="passed_spec_name">should return a JSON encoded hash</span></dd>
|
808
|
+
</dl>
|
809
|
+
</div>
|
810
|
+
<div class="example_group">
|
811
|
+
<dl>
|
812
|
+
<dt id="example_group_61">RelaxDB::ReferencesManyProxy</dt>
|
813
|
+
</dl>
|
814
|
+
</div>
|
815
|
+
<div class="example_group">
|
816
|
+
<dl>
|
817
|
+
<dt id="example_group_62">RelaxDB::ReferencesManyProxy references_many</dt>
|
818
|
+
<script type="text/javascript">moveProgressBar('74.0');</script>
|
819
|
+
<dd class="spec passed"><span class="passed_spec_name">should preserve the relationships across the save / load boundary</span></dd>
|
820
|
+
<script type="text/javascript">moveProgressBar('74.5');</script>
|
821
|
+
<dd class="spec passed"><span class="passed_spec_name">should issue only a single request to resolve the relationship</span></dd>
|
822
|
+
<script type="text/javascript">moveProgressBar('75.0');</script>
|
823
|
+
<dd class="spec passed"><span class="passed_spec_name">should not resolve the relationship when an object is instantiated</span></dd>
|
824
|
+
<script type="text/javascript">moveProgressBar('75.4');</script>
|
825
|
+
<dd class="spec passed"><span class="passed_spec_name">should make the ids available as a property</span></dd>
|
826
|
+
</dl>
|
827
|
+
</div>
|
828
|
+
<div class="example_group">
|
829
|
+
<dl>
|
830
|
+
<dt id="example_group_63">RelaxDB::ReferencesManyProxy references_many#=</dt>
|
831
|
+
<script type="text/javascript">moveProgressBar('75.9');</script>
|
832
|
+
<dd class="spec passed"><span class="passed_spec_name">should not be invoked</span></dd>
|
833
|
+
</dl>
|
834
|
+
</div>
|
835
|
+
<div class="example_group">
|
836
|
+
<dl>
|
837
|
+
<dt id="example_group_64">RelaxDB::ReferencesManyProxy references_many#<<</dt>
|
838
|
+
<script type="text/javascript">moveProgressBar('76.3');</script>
|
839
|
+
<dd class="spec passed"><span class="passed_spec_name">should set the relationship on both sides</span></dd>
|
840
|
+
<script type="text/javascript">moveProgressBar('76.8');</script>
|
841
|
+
<dd class="spec passed"><span class="passed_spec_name">should not create duplicates when the same object is added more than once</span></dd>
|
842
|
+
<script type="text/javascript">moveProgressBar('77.3');</script>
|
843
|
+
<dd class="spec passed"><span class="passed_spec_name">should not create duplicates when reciprocal objects are added from opposite sides</span></dd>
|
844
|
+
<script type="text/javascript">moveProgressBar('77.7');</script>
|
845
|
+
<dd class="spec passed"><span class="passed_spec_name">will resolve the reciprocal relationship</span></dd>
|
846
|
+
</dl>
|
847
|
+
</div>
|
848
|
+
<div class="example_group">
|
849
|
+
<dl>
|
850
|
+
<dt id="example_group_65">RelaxDB::ReferencesManyProxy references_many#delete</dt>
|
851
|
+
<script type="text/javascript">moveProgressBar('78.2');</script>
|
852
|
+
<dd class="spec passed"><span class="passed_spec_name">should nullify relationship on both sides</span></dd>
|
853
|
+
</dl>
|
854
|
+
</div>
|
855
|
+
<div class="example_group">
|
856
|
+
<dl>
|
857
|
+
<dt id="example_group_66">RelaxDB::ReferencesManyProxy references_many owner#destroy</dt>
|
858
|
+
<script type="text/javascript">moveProgressBar('78.7');</script>
|
859
|
+
<dd class="spec passed"><span class="passed_spec_name">should remove its membership from its peers in memory</span></dd>
|
860
|
+
<script type="text/javascript">moveProgressBar('79.1');</script>
|
861
|
+
<dd class="spec passed"><span class="passed_spec_name">should remove its membership from its peers in CouchDB</span></dd>
|
862
|
+
</dl>
|
863
|
+
</div>
|
864
|
+
<div class="example_group">
|
865
|
+
<dl>
|
866
|
+
<dt id="example_group_67">RelaxDB</dt>
|
867
|
+
</dl>
|
868
|
+
</div>
|
869
|
+
<div class="example_group">
|
870
|
+
<dl>
|
871
|
+
<dt id="example_group_68">RelaxDB.create_object</dt>
|
872
|
+
<script type="text/javascript">moveProgressBar('79.6');</script>
|
873
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an instance of a known object if passed a hash with a class key</span></dd>
|
874
|
+
<script type="text/javascript">moveProgressBar('80.0');</script>
|
875
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an instance of a dynamically created object if no class key is provided</span></dd>
|
876
|
+
</dl>
|
877
|
+
</div>
|
878
|
+
<div class="example_group">
|
879
|
+
<dl>
|
880
|
+
<dt id="example_group_69">RelaxDB.bulk_save</dt>
|
881
|
+
<script type="text/javascript">moveProgressBar('80.5');</script>
|
882
|
+
<dd class="spec passed"><span class="passed_spec_name">should be invokable multiple times</span></dd>
|
883
|
+
<script type="text/javascript">moveProgressBar('81.0');</script>
|
884
|
+
<dd class="spec passed"><span class="passed_spec_name">should return the objects it was passed</span></dd>
|
885
|
+
<script type="text/javascript">moveProgressBar('81.4');</script>
|
886
|
+
<dd class="spec passed"><span class="passed_spec_name">should succeed when passed no args</span></dd>
|
887
|
+
<script type="text/javascript">moveProgressBar('81.9');</script>
|
888
|
+
<dd class="spec passed"><span class="passed_spec_name">should return false on failure</span></dd>
|
889
|
+
<script type="text/javascript">moveProgressBar('82.4');</script>
|
890
|
+
<dd class="spec passed"><span class="passed_spec_name">should not attempt to save if a pre-save stage fails</span></dd>
|
891
|
+
<script type="text/javascript">moveProgressBar('82.8');</script>
|
892
|
+
<dd class="spec passed"><span class="passed_spec_name">should invoke the after-save stage after a successful save</span></dd>
|
893
|
+
</dl>
|
894
|
+
</div>
|
895
|
+
<div class="example_group">
|
896
|
+
<dl>
|
897
|
+
<dt id="example_group_70">RelaxDB.bulk_save!</dt>
|
898
|
+
<script type="text/javascript">moveProgressBar('83.3');</script>
|
899
|
+
<dd class="spec passed"><span class="passed_spec_name">should raise an exception if a obj fails validation</span></dd>
|
900
|
+
<script type="text/javascript">moveProgressBar('83.7');</script>
|
901
|
+
<dd class="spec passed"><span class="passed_spec_name">will not raise an exception if a document update conflict occurs on save</span></dd>
|
902
|
+
</dl>
|
903
|
+
</div>
|
904
|
+
<div class="example_group">
|
905
|
+
<dl>
|
906
|
+
<dt id="example_group_71">RelaxDB.replicate_db</dt>
|
907
|
+
<script type="text/javascript">moveProgressBar('84.2');</script>
|
908
|
+
<dd class="spec passed"><span class="passed_spec_name">should replicate the named database</span></dd>
|
909
|
+
</dl>
|
910
|
+
</div>
|
911
|
+
<div class="example_group">
|
912
|
+
<dl>
|
913
|
+
<dt id="example_group_72">RelaxDB.load</dt>
|
914
|
+
<script type="text/javascript">moveProgressBar('84.7');</script>
|
915
|
+
<dd class="spec passed"><span class="passed_spec_name">should load a single document</span></dd>
|
916
|
+
<script type="text/javascript">moveProgressBar('85.1');</script>
|
917
|
+
<dd class="spec passed"><span class="passed_spec_name">should load an arbitrary number of documents</span></dd>
|
918
|
+
<script type="text/javascript">moveProgressBar('85.6');</script>
|
919
|
+
<dd class="spec passed"><span class="passed_spec_name">should return nil when given a id for a non existant doc</span></dd>
|
920
|
+
<script type="text/javascript">moveProgressBar('86.1');</script>
|
921
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an array with correctly placed nils when given a list containing non existant doc ids</span></dd>
|
922
|
+
</dl>
|
923
|
+
</div>
|
924
|
+
<div class="example_group">
|
925
|
+
<dl>
|
926
|
+
<dt id="example_group_73">RelaxDB.load!</dt>
|
927
|
+
<script type="text/javascript">moveProgressBar('86.5');</script>
|
928
|
+
<dd class="spec passed"><span class="passed_spec_name">should load a single document</span></dd>
|
929
|
+
<script type="text/javascript">moveProgressBar('87.0');</script>
|
930
|
+
<dd class="spec passed"><span class="passed_spec_name">should load multiple documents</span></dd>
|
931
|
+
<script type="text/javascript">moveProgressBar('87.5');</script>
|
932
|
+
<dd class="spec passed"><span class="passed_spec_name">should throw an exception if given a single id for a non-existant doc</span></dd>
|
933
|
+
<script type="text/javascript">moveProgressBar('87.9');</script>
|
934
|
+
<dd class="spec passed"><span class="passed_spec_name">should throw an exception if any of a list of doc ids is for a non-existant doc</span></dd>
|
935
|
+
</dl>
|
936
|
+
</div>
|
937
|
+
<div class="example_group">
|
938
|
+
<dl>
|
939
|
+
<dt id="example_group_74">RelaxDB.view</dt>
|
940
|
+
<script type="text/javascript">moveProgressBar('88.4');</script>
|
941
|
+
<dd class="spec passed"><span class="passed_spec_name">should request a view and return an array</span></dd>
|
942
|
+
<script type="text/javascript">moveProgressBar('88.8');</script>
|
943
|
+
<dd class="spec passed"><span class="passed_spec_name">may accept query params</span></dd>
|
944
|
+
<script type="text/javascript">moveProgressBar('89.3');</script>
|
945
|
+
<dd class="spec passed"><span class="passed_spec_name">should be queryable with a multi key post</span></dd>
|
946
|
+
<script type="text/javascript">moveProgressBar('89.8');</script>
|
947
|
+
<dd class="spec passed"><span class="passed_spec_name">should return nil for a reduce view with no results</span></dd>
|
948
|
+
<script type="text/javascript">moveProgressBar('90.2');</script>
|
949
|
+
<dd class="spec passed"><span class="passed_spec_name">should return a single value for a reduce view with a single result</span></dd>
|
950
|
+
<script type="text/javascript">moveProgressBar('90.7');</script>
|
951
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an array for a reduce view with multiple results</span></dd>
|
952
|
+
</dl>
|
953
|
+
</div>
|
954
|
+
<div class="example_group">
|
955
|
+
<dl>
|
956
|
+
<dt id="example_group_75">RelaxDB.merge</dt>
|
957
|
+
<script type="text/javascript">moveProgressBar('91.2');</script>
|
958
|
+
<dd class="spec passed"><span class="passed_spec_name">should merge rows sharing a common merge key into a single ViewObject</span></dd>
|
959
|
+
</dl>
|
960
|
+
</div>
|
961
|
+
<div class="example_group">
|
962
|
+
<dl>
|
963
|
+
<dt id="example_group_76">RelaxDB create_views disabled</dt>
|
964
|
+
<script type="text/javascript">moveProgressBar('91.6');</script>
|
965
|
+
<dd class="spec passed"><span class="passed_spec_name">should not create any views</span></dd>
|
966
|
+
</dl>
|
967
|
+
</div>
|
968
|
+
<div class="example_group">
|
969
|
+
<dl>
|
970
|
+
<dt id="example_group_77">RelaxDB create_views enabled</dt>
|
971
|
+
<script type="text/javascript">moveProgressBar('92.1');</script>
|
972
|
+
<dd class="spec passed"><span class="passed_spec_name">should create all views</span></dd>
|
973
|
+
</dl>
|
974
|
+
</div>
|
975
|
+
<div class="example_group">
|
976
|
+
<dl>
|
977
|
+
<dt id="example_group_78">RelaxDB</dt>
|
978
|
+
</dl>
|
979
|
+
</div>
|
980
|
+
<div class="example_group">
|
981
|
+
<dl>
|
982
|
+
<dt id="example_group_79">RelaxDB GET</dt>
|
983
|
+
<script type="text/javascript">moveProgressBar('92.5');</script>
|
984
|
+
<dd class="spec passed"><span class="passed_spec_name">should raise a HTTP_404 for a non existant doc</span></dd>
|
985
|
+
<script type="text/javascript">moveProgressBar('93.0');</script>
|
986
|
+
<dd class="spec passed"><span class="passed_spec_name">should raise a RuntimeError for non specific errors</span></dd>
|
987
|
+
</dl>
|
988
|
+
</div>
|
989
|
+
<div class="example_group">
|
990
|
+
<dl>
|
991
|
+
<dt id="example_group_80">view_by</dt>
|
992
|
+
</dl>
|
993
|
+
</div>
|
994
|
+
<div class="example_group">
|
995
|
+
<dl>
|
996
|
+
<dt id="example_group_81">view_by view_by</dt>
|
997
|
+
<script type="text/javascript">moveProgressBar('93.5');</script>
|
998
|
+
<dd class="spec passed"><span class="passed_spec_name">should create corresponding views</span></dd>
|
999
|
+
<script type="text/javascript">moveProgressBar('93.9');</script>
|
1000
|
+
<dd class="spec passed"><span class="passed_spec_name">should create a by_ att list method</span></dd>
|
1001
|
+
<script type="text/javascript">moveProgressBar('94.4');</script>
|
1002
|
+
<dd class="spec passed"><span class="passed_spec_name">should create a paginate_by_ att list method</span></dd>
|
1003
|
+
<script type="text/javascript">moveProgressBar('94.9');</script>
|
1004
|
+
<dd class="spec passed"><span class="passed_spec_name">should apply query defaults to by_</span></dd>
|
1005
|
+
<script type="text/javascript">moveProgressBar('95.3');</script>
|
1006
|
+
<dd class="spec passed"><span class="passed_spec_name">should allow a single arg to be passed to by_</span></dd>
|
1007
|
+
<script type="text/javascript">moveProgressBar('95.8');</script>
|
1008
|
+
<dd class="spec passed"><span class="passed_spec_name">should apply query defaults to paginate_by_</span></dd>
|
1009
|
+
<script type="text/javascript">moveProgressBar('96.2');</script>
|
1010
|
+
<dd class="spec passed"><span class="passed_spec_name">should allow query defaults to be overridden for paginate_by_</span></dd>
|
1011
|
+
<script type="text/javascript">moveProgressBar('96.7');</script>
|
1012
|
+
<dd class="spec passed"><span class="passed_spec_name">should allow query defaults to be overridden for by_</span></dd>
|
1013
|
+
</dl>
|
1014
|
+
</div>
|
1015
|
+
<div class="example_group">
|
1016
|
+
<dl>
|
1017
|
+
<dt id="example_group_82">RelaxDB::ViewObject</dt>
|
1018
|
+
</dl>
|
1019
|
+
</div>
|
1020
|
+
<div class="example_group">
|
1021
|
+
<dl>
|
1022
|
+
<dt id="example_group_83">RelaxDB::ViewObject.new</dt>
|
1023
|
+
<script type="text/javascript">moveProgressBar('97.2');</script>
|
1024
|
+
<dd class="spec passed"><span class="passed_spec_name">should provide readers for the object passed in the hash</span></dd>
|
1025
|
+
<script type="text/javascript">moveProgressBar('97.6');</script>
|
1026
|
+
<dd class="spec passed"><span class="passed_spec_name">should try to convert objects ending in _at to a time</span></dd>
|
1027
|
+
</dl>
|
1028
|
+
</div>
|
1029
|
+
<div class="example_group">
|
1030
|
+
<dl>
|
1031
|
+
<dt id="example_group_84">RelaxDB::ViewObject.create</dt>
|
1032
|
+
<script type="text/javascript">moveProgressBar('98.1');</script>
|
1033
|
+
<dd class="spec passed"><span class="passed_spec_name">should return an array of view objects when passed an array</span></dd>
|
1034
|
+
<script type="text/javascript">moveProgressBar('98.6');</script>
|
1035
|
+
<dd class="spec passed"><span class="passed_spec_name">should return a view object when passed a hash</span></dd>
|
1036
|
+
<script type="text/javascript">moveProgressBar('99.0');</script>
|
1037
|
+
<dd class="spec passed"><span class="passed_spec_name">should return a simple value when passed a primitive</span></dd>
|
1038
|
+
</dl>
|
1039
|
+
</div>
|
1040
|
+
<div class="example_group">
|
1041
|
+
<dl>
|
1042
|
+
<dt id="example_group_85">RelaxDB::View</dt>
|
1043
|
+
</dl>
|
1044
|
+
</div>
|
1045
|
+
<div class="example_group">
|
1046
|
+
<dl>
|
1047
|
+
<dt id="example_group_86">RelaxDB::View exists</dt>
|
1048
|
+
<script type="text/javascript">moveProgressBar('99.5');</script>
|
1049
|
+
<dd class="spec passed"><span class="passed_spec_name">should return nil if a view doesnt exist</span></dd>
|
1050
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
1051
|
+
<dd class="spec passed"><span class="passed_spec_name">should return the view if it exits</span></dd>
|
1052
|
+
</dl>
|
1053
|
+
</div>
|
1054
|
+
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>32.605052 seconds</strong>";</script>
|
1055
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "216 examples, 1 failure";</script>
|
1056
|
+
</div>
|
1057
|
+
</div>
|
1058
|
+
</body>
|
1059
|
+
</html>
|