mongoid_versioned_atomic 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.1
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: 2017-12-31 00:00:00.000000000 Z
11
+ date: 2018-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake