Last version is failing #7

Closed
maxguzenski opened this Issue Mar 16, 2013 · 4 comments

3 participants

@maxguzenski
# 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

@elado

+1

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

@grosser
Owner

A failing test-case would be very helpful!

@elado

Sample app:

rails new test_after_commit
cd test_after_commit
echo "gem 'test_after_commit'" >> Gemfile
bundle
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 = u.authentications.new
a.save!
a.id # => the id
@grosser
Owner

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