mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Fix offense constant definition in block in validators/integer_array_validator_spec.rb
This commit is contained in:
@@ -6,13 +6,6 @@
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 16
|
||||
# Configuration parameters: AllowedMethods.
|
||||
# AllowedMethods: enums
|
||||
Lint/ConstantDefinitionInBlock:
|
||||
Exclude:
|
||||
- 'spec/validators/integer_array_validator_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
Lint/DuplicateMethods:
|
||||
Exclude:
|
||||
|
||||
@@ -3,14 +3,6 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe IntegerArrayValidator do
|
||||
class TestModel
|
||||
include ActiveModel::Validations
|
||||
|
||||
attr_accessor :ids
|
||||
|
||||
validates :ids, integer_array: true
|
||||
end
|
||||
|
||||
describe "internationalization" do
|
||||
it "has translation for NOT_ARRAY_ERROR" do
|
||||
expect(described_class.not_array_error).not_to be_blank
|
||||
@@ -22,7 +14,14 @@ describe IntegerArrayValidator do
|
||||
end
|
||||
|
||||
describe "validation" do
|
||||
let(:instance) { TestModel.new }
|
||||
let(:instance) do
|
||||
Class.new do
|
||||
include ActiveModel::Validations
|
||||
attr_accessor :ids
|
||||
|
||||
validates :ids, integer_array: true
|
||||
end.new
|
||||
end
|
||||
|
||||
it "does not add error when nil" do
|
||||
instance.ids = nil
|
||||
|
||||
Reference in New Issue
Block a user