-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Tests break when upgrading from 0.7.2 to 0.7.4 #228
Comments
Hi @jmuheim, can you upgrade to the latest 0.8.x version and see if you're experiencing the same failure? |
Yes I do. |
Ok, thanks for that. Are you able to isolate this failure so that you don't rely on |
@jmuheim, can you let us know where you're at, or close the issue if you've managed to sort it out :) |
@jmuheim, I'm closing this for now. Let me know if you want to reopen it. Also, try |
I'm sorry for not responding. The problem has disappeared with the newest version. Thank you. |
Great to hear! :) |
Just in case anyone else ends up here. I was upgrading from 0.6 and tests started to fail when going from 0.7.2 to 0.7.4. All list items had position "1". We are using Factory Girl 4.5 and Rails 4.2. This is how the code looks that was creating the list items Once I changed it to Note that we are using acts_as_list with a scope. Looks like the position is first calculated when the list item is created (with scope "list_id = nil") which gives position "1". Appending the item to a list (using "<<") does not re-compute the position. So, supplying a list when the item is created fixes the problem. Could be an issue with FactoryGirl that has been corrected long time ago. |
That's a strange one. Changing the list and re-saving the item should change the position to the next available position in the list. But you're right, supplying the list on create will give you correct positions :) |
@calleo, looking at this further, I'm wondering if If you wanted to look into this further, feel free :) I'm happy to provide some guidance if necessary :) |
I have the following model:
With the following test:
end
With
acts_as_list
v0.7.2, it passes:With v0.7.4, it doesn't:
Any idea what's going on here?
The text was updated successfully, but these errors were encountered: