spec/mongoid/user_spec.rb in sorcery-0.8.6 vs spec/mongoid/user_spec.rb in sorcery-0.9.0
- old
+ new
@@ -33,6 +33,19 @@
expect(SubUser.fields).to include("blabla")
end
end
+ describe "increment" do
+ it "increments attribute" do
+ User.class_eval do
+ field :some_number, type: Integer
+ end
+
+ user = User.new(some_number: 3)
+ user.sorcery_adapter.increment(:some_number)
+
+ expect(user.some_number).to eql 4
+ end
+ end
+
end