Last version is failing #7

maxguzenski opened this Issue Mar 16, 2013 · 4 comments

3 participants

# with test_after_commit 0.0.1 below line create a friendship correctly
# with test_after_commit 0.1.0 it is returning nill

request = friend.friendships.create(friend_id: id, status: 'pending')

I use ruby 2.0, rails 3.2 and rspec last version



Took me a bit to understand this gem is my problem... It screws up has_many association creation.


A failing test-case would be very helpful!


Sample app:

rails new test_after_commit
cd test_after_commit
echo "gem 'test_after_commit'" >> Gemfile
rails g model user name
rails g model authentication user:belongs_to
echo "class User; has_many :authentications; end" >> app/models/user.rb
rake db:migrate
rails c

In console:

u = User.create!
u.authentications.create! # => nil !!

# however,
a =! # => the id

0.1.1 should fix that!

@grosser grosser closed this Mar 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment