From 351111f6718a288bb17282d9d96294667b54d8c3 Mon Sep 17 00:00:00 2001 From: Jacob Kagon Date: Wed, 8 Jan 2025 13:26:59 -0500 Subject: [PATCH] robocop fix --- app/models/email.rb | 9 ++++----- spec/models/email_spec.rb | 18 +++++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/models/email.rb b/app/models/email.rb index 6e6bb30da33..99408ae5b6c 100644 --- a/app/models/email.rb +++ b/app/models/email.rb @@ -28,11 +28,10 @@ class Email validates_inclusion_of :kind, in: KINDS, message: "%{value} is not a valid email type" validates :address, - format: { - :with => /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i, - - :message => "should be a valid email address" - } + format: { + :with => /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i, + :message => "should be a valid email address" + } validates :address, presence: true diff --git a/spec/models/email_spec.rb b/spec/models/email_spec.rb index 6082b76d0f8..a72208eb29a 100644 --- a/spec/models/email_spec.rb +++ b/spec/models/email_spec.rb @@ -42,16 +42,16 @@ end end - context "valid address" do - let(:email) {"test@test.com"} - let(:params){valid_params.deep_merge!(address: email)} - - it "is valid" do - Email.create(params) - person.reload - expect(person.emails.where(address: email).first.valid?).to be_truthy - end + context "valid address" do + let(:email) {"test@test.com"} + let(:params){valid_params.deep_merge!(address: email)} + + it "is valid" do + Email.create(params) + person.reload + expect(person.emails.where(address: email).first.valid?).to be_truthy end + end valid_types = Email::KINDS valid_types.each do |type|