mongoid_versioned_atomic 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongoid_versioned_atomic/v_atomic.rb +49 -31
- data/lib/mongoid_versioned_atomic/version.rb +1 -1
- data/test/dummy/app/models/user.rb +2 -1
- data/test/dummy/log/test.log +4206 -0
- data/test/v_atomic_test.rb +18 -0
- metadata +2 -2
data/test/v_atomic_test.rb
CHANGED
@@ -363,6 +363,24 @@ class CoreExtTest < ActiveSupport::TestCase
|
|
363
363
|
|
364
364
|
end
|
365
365
|
|
366
|
+
def test_af_cal
|
367
|
+
# create a user
|
368
|
+
|
369
|
+
u = User.new
|
370
|
+
u.name = "bhargav"
|
371
|
+
u.email = "god@gmail.com"
|
372
|
+
u.versioned_create
|
373
|
+
puts u.op_success
|
374
|
+
# now try to create another user with the same email.
|
375
|
+
# the after callback should not pass.
|
376
|
+
|
377
|
+
u2 = User.new
|
378
|
+
u2.name = "dog"
|
379
|
+
u2.email = "god@gmail.com"
|
380
|
+
u2.versioned_create({"email" => u2.email})
|
381
|
+
assert_equal 0, u2.after_create_field, "the after create callback should not have succeeded."
|
382
|
+
end
|
383
|
+
|
366
384
|
|
367
385
|
def test_after_create_callbacks
|
368
386
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_versioned_atomic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greatmanta111
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|