Skip to content
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

Rspec + reify(has_many: true) #823

Closed
lakesare opened this issue Jun 3, 2016 · 2 comments
Closed

Rspec + reify(has_many: true) #823

lakesare opened this issue Jun 3, 2016 · 2 comments

Comments

@lakesare
Copy link

lakesare commented Jun 3, 2016

(PaperTrail 5.1.1)
I'm having troubles with

  it '', versioning: true do
    guide.update!({ title: '1', steps_attributes: [ { description: 'a' }  ] })
    p guide.versions[2].reify(has_many: true).steps.map(&:description)
  end

In console same code predictably prints ['a'], in rspec [].
Same happens with:

  • require 'paper_trail/frameworks/rspec' not used
  • running it with spring rspec
  • disabling DatabaseCleaner

It does work outside the it block in test environment.

@jaredbeck
Copy link
Member

Hi Hel. Thanks for testing this experimental feature (associations). It might be this known issue: Reification of associations is not compatible with transactional tests

@jaredbeck
Copy link
Member

Based on your +1 I'll assume this issue is a duplicate and close it. Thanks for the feedbcak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants