Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Commit

Permalink
Remove presence validations on address
Browse files Browse the repository at this point in the history
  • Loading branch information
hartsick committed Jan 11, 2022
1 parent 179ac62 commit ff4d405
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/models/kit_request.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class KitRequest < ApplicationRecord
encrypts :first_name, :last_name, :email, :mailing_address_1, :mailing_address_2
encrypts :first_name, :last_name, :email, :mailing_address_1, :mailing_address_2, :smarty_response

validates_presence_of :first_name, :last_name, :mailing_address_1, :state, :zip_code
validates_presence_of :first_name, :last_name

validate :valid_mailing_address

Expand Down
15 changes: 0 additions & 15 deletions spec/models/kit_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@
expect(FactoryBot.build(:kit_request, last_name: "McTester")).to be_valid
end

it "requires mailing address 1" do
expect(FactoryBot.build(:kit_request, mailing_address_1: nil)).to_not be_valid
expect(FactoryBot.build(:kit_request, mailing_address_1: "1234 Fake St")).to be_valid
end

it "requires zip code" do
expect(FactoryBot.build(:kit_request, zip_code: nil)).to_not be_valid
expect(FactoryBot.build(:kit_request, zip_code: "12345")).to be_valid
end

it "requires state" do
expect(FactoryBot.build(:kit_request, state: nil)).to_not be_valid
expect(FactoryBot.build(:kit_request, state: "OH")).to be_valid
end

describe "address validation" do
context "no matches returned" do
it "is invalid and assigns an error to mailing adddress" do
Expand Down

0 comments on commit ff4d405

Please sign in to comment.