This repository has been archived by the owner on Jun 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support email field on Location (#530)
- Loading branch information
Thomas McGoey-Smith
authored
Jul 21, 2017
1 parent
448a674
commit ac496c7
Showing
3 changed files
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,8 @@ def location_fixtures | |
:address1 => '110 Laurier Avenue West', | ||
:postal_code => 'K1P 1J1', | ||
:phone => '1-613-580-2400', | ||
:fax => '1-613-580-2495'), | ||
:fax => '1-613-580-2495', | ||
:email => '[email protected]'), | ||
:ottawa_with_name => Location.new( :country => 'CA', | ||
:province => 'ON', | ||
:city => 'Ottawa', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ class LocationTest < ActiveSupport::TestCase | |
address: '66 Gregory Ave.', | ||
phone: '515-555-1212', | ||
fax_number: 'none to speak of', | ||
email: '[email protected]', | ||
address_type: :commercial, | ||
name: "Bob Bobsen", | ||
} | ||
|
@@ -35,6 +36,7 @@ class LocationTest < ActiveSupport::TestCase | |
assert_equal @attributes_hash[:address], location.address1 | ||
assert_equal @attributes_hash[:phone], location.phone | ||
assert_equal @attributes_hash[:fax_number], location.fax | ||
assert_equal @attributes_hash[:email], location.email | ||
assert_equal @attributes_hash[:address_type].to_s, location.address_type | ||
assert_equal @attributes_hash[:name], location.name | ||
end | ||
|
@@ -62,6 +64,7 @@ def respond_to?(method) | |
assert_equal @attributes_hash[:address], location.address1 | ||
assert_equal @attributes_hash[:phone], location.phone | ||
assert_equal @attributes_hash[:fax_number], location.fax | ||
assert_equal @attributes_hash[:email], location.email | ||
assert_equal @attributes_hash[:address_type].to_s, location.address_type | ||
assert_equal @attributes_hash[:name], location.name | ||
end | ||
|
@@ -116,7 +119,7 @@ def province_code | |
end | ||
|
||
test "#inspect returns a readable string" do | ||
expected = "110 Laurier Avenue West\nOttawa, ON, K1P 1J1\nCanada\nPhone: 1-613-580-2400\nFax: 1-613-580-2495" | ||
expected = "110 Laurier Avenue West\nOttawa, ON, K1P 1J1\nCanada\nPhone: 1-613-580-2400\nFax: 1-613-580-2495\nEmail: [email protected]" | ||
assert_equal expected, @location.inspect | ||
end | ||
|
||
|
@@ -165,7 +168,7 @@ def province_code | |
end | ||
|
||
test "#to_hash has the expected attributes" do | ||
expected = %w(address1 address2 address3 address_type city company_name country fax name phone postal_code province) | ||
expected = %w(address1 address2 address3 address_type city company_name country email fax name phone postal_code province) | ||
|
||
assert_equal expected, @location.to_hash.stringify_keys.keys.sort | ||
end | ||
|