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

Update RSpec matchers to work with custom version association names #925

Conversation

kitop
Copy link
Contributor

@kitop kitop commented Feb 6, 2017

have_a_version_with and have_a_version_with_changes had the
versions association call hardcoded.
If has_paper_trail had the versions option set to something else
(e.g: has_paper_trail versions: :paper_trail_versions) the matcher
couldn't be used.

This fixes that issue by dynamically fetching the association name from
the :versions_association_name class attribute.

@jaredbeck
Copy link
Member

Thanks, Esteban! Looks good. Please add a test in spec/models/document_spec.rb, and add an entry to the changelog.

@kitop
Copy link
Contributor Author

kitop commented Feb 7, 2017

Sure. On it!

@kitop kitop changed the title Update rspec matcher to work with custom version association names Update RSpec matchers to work with custom version association names Feb 7, 2017
@kitop kitop force-pushed the rspec-matchers-custom-association-names branch from 97681fc to 1677508 Compare February 7, 2017 09:25
`have_a_version_with` and `have_a_version_with_changes` had the
`versions` association call hardcoded.
If `has_paper_trail` had the `versions` option set to something else
(e.g: `has_paper_trail versions: :paper_trail_versions`) the matcher
couldn't be used.

This fixes that issue by dynamically fetching the association name from
the `:versions_association_name` class attribute.
@kitop kitop force-pushed the rspec-matchers-custom-association-names branch from 1677508 to 60847d6 Compare February 7, 2017 09:26
@kitop
Copy link
Contributor Author

kitop commented Feb 7, 2017

Done, and squashed.

@jaredbeck jaredbeck merged commit 81db706 into paper-trail-gem:master Feb 7, 2017
@jaredbeck
Copy link
Member

Nice work, thanks!

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

Successfully merging this pull request may close these issues.

2 participants