Skip to content

Commit

Permalink
Remove unneeded address#first_lines method
Browse files Browse the repository at this point in the history
Used to be used to supply address one and two as one line to
CCMS but does not appear to be necessary.
  • Loading branch information
jsugarman committed Dec 11, 2023
1 parent 52d0e99 commit 3129f93
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
4 changes: 0 additions & 4 deletions app/models/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ def pretty_postcode?
postcode[-4] == " "
end

def first_lines
[address_line_one, address_line_two].select(&:present?).join(" ")
end

def to_json(*_args)
{
address_line_one:,
Expand Down
16 changes: 0 additions & 16 deletions spec/models/address_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,4 @@
model.postcode = "SW1H9AJ"
expect(model.pretty_postcode).to eq("SW1H 9AJ")
end

context "when the address has lines one and two populated" do
it "first_lines displays the first two lines of the address concatenated" do
model.address_line_one = "102"
model.address_line_two = "Petty France"
expect(model.first_lines).to eq("102 Petty France")
end
end

context "when the address has only line one populated" do
it "first_lines displays only the first line of the address" do
model.address_line_one = "102"
model.address_line_two = nil
expect(model.first_lines).to eq("102")
end
end
end

0 comments on commit 3129f93

Please sign in to comment.