File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
spec/unit/spark_api/models Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ def shared_notes(fore=nil)
129
129
end
130
130
131
131
def street_address
132
- self . UnparsedFirstLineAddress . delete ( DATA_MASK ) . strip ( ) . gsub ( /\s {2,}/ , ' ' )
132
+ ( self . UnparsedFirstLineAddress || '' ) . delete ( DATA_MASK ) . strip ( ) . gsub ( /\s {2,}/ , ' ' )
133
133
end
134
134
135
135
def region_address
Original file line number Diff line number Diff line change 87
87
@listing . should_not respond_to ( :Videos )
88
88
end
89
89
90
- it "should return street address" do
91
- @listing . street_address . should eq ( "100 Someone's St" )
92
- end
90
+ describe '.street_address' do
91
+ it 'should return the street address' do
92
+ @listing . street_address . should eq ( "100 Someone's St" )
93
+ end
94
+
95
+ it 'should remove data masks' do
96
+ @listing . StandardFields [ "UnparsedFirstLineAddress" ] = "********"
97
+ @listing . street_address . should eq ( "" )
98
+ end
93
99
94
- it "should remove masks from the street address" do
95
- @listing . StandardFields [ "UnparsedFirstLineAddress" ] = "********"
96
- @listing . street_address . should eq ( "" )
100
+ it 'should handle a missing unparsed first line address' do
101
+ [ nil , '' , ' ' ] . each do |current |
102
+ @listing . StandardFields [ 'UnparsedFirstLineAddress' ] = current
103
+ @listing . street_address . should eq ( '' )
104
+ end
105
+ end
97
106
end
98
107
99
108
it "should return the regional address" do
You can’t perform that action at this time.
0 commit comments