rentjuicer 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -58,17 +58,17 @@ module Rentjuicer
58
58
  end
59
59
 
60
60
  def mls_disclaimer
61
- attribution_split[1].gsub('<br />', '') if mls_listing? && attribution_split[1]
61
+ attribution_split[1].gsub('<br />', '') if mls_listing? && attribution_split && attribution_split[1]
62
62
  end
63
63
 
64
64
  def courtesy_of
65
- attribution_split[0] if mls_listing?
65
+ attribution_split[0] if mls_listing? && attribution_split && attribution_split[0]
66
66
  end
67
67
 
68
68
  private
69
69
 
70
70
  def attribution_split
71
- @attribution_parts ||= attribution.split('<br />', 2)
71
+ @attribution_parts ||= attribution.split('<br />', 2) unless attribution.blank?
72
72
  end
73
73
 
74
74
  end
data/rentjuicer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rentjuicer}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tcocca"]
12
- s.date = %q{2010-12-14}
12
+ s.date = %q{2010-12-29}
13
13
  s.description = %q{Ruby API wrapper for rentjuice.com built with httparty}
14
14
  s.email = %q{tom.cocca@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -142,6 +142,53 @@ describe Rentjuicer::Listing do
142
142
  it { @listing.courtesy_of.should == "<img src=\"http://idx.advancedaccess.com/disclaimer/brlogo125.jpg\" style=\"float:left; padding-right:10px;\" />Listing office: XYZ Realty"}
143
143
  it { @listing.mls_disclaimer.should == "Properties marked with the MRED approved icon are courtesy of Midwest Real Estate Data, LLC. Information deemed reliable but not guaranteed. Copyright&copy; 2010 Midwest Real Estate Data LLC. All rights reserved."}
144
144
  end
145
+
146
+ context "nil attribution" do
147
+ before do
148
+ @listing = Rentjuicer::Listing.new(valid_listing_rash.merge({
149
+ "source_type" => "mls",
150
+ "source_name" => "MLS PIN",
151
+ "attribution" => nil
152
+ }))
153
+ end
154
+
155
+ it { @listing.mls_listing?.should be_true }
156
+ it { @listing.source_name.should == "MLS PIN" }
157
+ it { @listing.attribution.should == nil}
158
+ it { @listing.courtesy_of.should == nil}
159
+ it { @listing.mls_disclaimer.should == nil}
160
+ end
161
+
162
+ context "missing attribution" do
163
+ before do
164
+ @listing = Rentjuicer::Listing.new(valid_listing_rash.merge({
165
+ "source_type" => "mls",
166
+ "source_name" => "MLS PIN"
167
+ }))
168
+ end
169
+
170
+ it { @listing.mls_listing?.should be_true }
171
+ it { @listing.source_name.should == "MLS PIN" }
172
+ it { @listing.attribution.should == nil}
173
+ it { @listing.courtesy_of.should == nil}
174
+ it { @listing.mls_disclaimer.should == nil}
175
+ end
176
+
177
+ context "blank attribution" do
178
+ before do
179
+ @listing = Rentjuicer::Listing.new(valid_listing_rash.merge({
180
+ "source_type" => "mls",
181
+ "source_name" => "MLS PIN",
182
+ "attribution" => ""
183
+ }))
184
+ end
185
+
186
+ it { @listing.mls_listing?.should be_true }
187
+ it { @listing.source_name.should == "MLS PIN" }
188
+ it { @listing.attribution.should == ""}
189
+ it { @listing.courtesy_of.should == nil}
190
+ it { @listing.mls_disclaimer.should == nil}
191
+ end
145
192
  end
146
193
 
147
194
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rentjuicer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - tcocca
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-12-14 00:00:00 -05:00
12
+ date: 2010-12-29 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency