-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding 'reload' to trackables specs #111
Conversation
Yes, We actually want to test both with and without reload I think, so maybe you can do something like [ nil, :reload ].each do |method|
context "#{method || 'instance'}" do
it "should recognize :from, :to options" do
comment.undo! user, from: 4, to: 2
comment.send(method) if method
comment.title.should == "test"
end
end
end This should be debugged. |
Also we should change all |
I've made the changes to the specs as you suggested. How can we go about solving the issue and getting the specs passing? |
@@ -677,22 +687,22 @@ class Foo < Comment | |||
|
|||
it "should recognize :from, :to options" do | |||
comment.redo! user, from: 2, to: 4 | |||
comment.title.should == "Test4" | |||
comment.reload.title.should == "Test4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are still reload
, I think you meant to delete these tests.
I can take a look soon, but in the meantime, see what is being passed into the final |
The Travis specs fail for a Rubocop violation, you should fix that. |
I have solved the issue and all the specs are passing. Please review |
Perfect. Can you please update CHANGELOG and squash these commits? Thx. |
To squash all the commits I have to delete my fork, create a new one and repush the squashed commits. Please view the new pull request #113 |
Closing this PR as you've moved it to #113 |
When using Mongoid 3.1.6, ruby 1.9.3 and Rails 3.2.16 I have found that
Undo!
andRedo!
methods are not persisting when called directly on the document. For example:However when calling these methods on the history tracks, changes are being persisted. For example:
I am not sure why this is the case, though I had a look at the specs and discovered that
reload
was not being called on the objects before checking ifundo!
orredo!
worked. I've decided to add that and the specs are now failing. Is this the intended behaviour?