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

Remove the with qualifier on define_enum_for matcher #1589

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,6 @@ def with_values(expected_enum_values)
self
end

def with(expected_enum_values)
Shoulda::Matchers.warn_about_deprecated_method(
'The `with` qualifier on `define_enum_for`',
'`with_values`',
)
with_values(expected_enum_values)
end

def with_prefix(expected_prefix = true)
options[:prefix] = expected_prefix
self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,6 @@ def self.statuses
end
end

context 'with values specified using #with' do
it 'produces a warning' do
record = build_record_with_array_values(
attribute_name: :attr,
values: [:foo, :bar],
)

assertion = lambda do
expect(record).to define_enum_for(:attr).with([:foo, :bar])
end

expect(&assertion).to deprecate(
'The `with` qualifier on `define_enum_for`',
'`with_values`',
)
end
end

describe 'with the backing column specified to be of some type' do
context 'if the column storing the attribute is of a different type' do
it 'rejects with an appropriate failure message' do
Expand Down
Loading