We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
with_prefix
When having two enums with the same string values in two different prefixes will not be distinguished by with_prefix and the tests pass.
class ContactSuggestion < ApplicationRecord STATUSES = { pending: 'pending', denied: 'denied', agreed: 'agreed' }.freeze enum :candidate_user_status, STATUSES, prefix: :user enum :candidate_contact_status, STATUSES, prefix: :contact end
describe 'validations' do subject(:described_instance) { described_class.new } it do expect(described_instance).to define_enum_for(:candidate_user_status) .with_values(agreed: 'agreed', pending: 'pending', denied: 'denied') .with_prefix(:user) end it do expect(described_instance).to define_enum_for(:candidate_contact_status) .with_values(agreed: 'agreed', pending: 'pending', denied: 'denied') .with_prefix(:user) # Wrong prefix here end end
As a user I would expect and hint by a failing spec that points out that candidate_contact_status is not prefixed by :user
candidate_contact_status
:user
The test passes with not harm or information.
shoulda_matchers version: 6.4.0 rails version: 8.0.1 ruby version: 3.3.4
6.4.0
8.0.1
3.3.4
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When having two enums with the same string values in two different prefixes
will not be distinguished by
with_prefix
and the tests pass.Reproduction Steps
Expected behavior
As a user I would expect and hint by a failing spec that points out that
candidate_contact_status
is not prefixed by:user
Actual behavior
The test passes with not harm or information.
System configuration
shoulda_matchers version:
6.4.0
rails version:
8.0.1
ruby version:
3.3.4
The text was updated successfully, but these errors were encountered: