diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e1e44cee6f..bc831cf76c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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: diff --git a/spec/validators/integer_array_validator_spec.rb b/spec/validators/integer_array_validator_spec.rb index 0fbb08fd20..0643d02806 100644 --- a/spec/validators/integer_array_validator_spec.rb +++ b/spec/validators/integer_array_validator_spec.rb @@ -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