communicator 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/communicator/version.rb +1 -1
- data/test/test_client.rb +25 -0
- metadata +4 -4
data/lib/communicator/version.rb
CHANGED
data/test/test_client.rb
CHANGED
@@ -121,6 +121,31 @@ class TestClient < Test::Unit::TestCase
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
+
# Ensure that we can delegate ID sequence processing to the remote by publishing
|
125
|
+
# an unpersisted record
|
126
|
+
context "After publishing a not-yet saved Post (that has no ID therefore)" do
|
127
|
+
setup do
|
128
|
+
@post = Post.new(:title => 'foo', :body => 'unpersisted post')
|
129
|
+
assert @post.publish
|
130
|
+
end
|
131
|
+
|
132
|
+
should "have created an Outbound Message that has a nil ID" do
|
133
|
+
assert_nil Communicator::OutboundMessage.last.message_content["post"]["id"]
|
134
|
+
end
|
135
|
+
|
136
|
+
context "after PUSH" do
|
137
|
+
setup do
|
138
|
+
Communicator::Client.push
|
139
|
+
end
|
140
|
+
|
141
|
+
should "have created the post in the server DB" do
|
142
|
+
remote_post = TestServerDatabase::Post.last
|
143
|
+
assert_equal 'unpersisted post', remote_post.body
|
144
|
+
assert remote_post.id > 0
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
124
149
|
# Make sure attributes skipped with :except are not saved at remote
|
125
150
|
context "PUSHing a new comment" do
|
126
151
|
setup do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: communicator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christoph Olszowka
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-14 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|