File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
spec/unit/spark_api/models Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ class SavedSearch < Base
8
8
9
9
attr_accessor :newsfeeds
10
10
11
+ # Newsfeed restriction criteria for saved searches:
12
+ # http://alpha.sparkplatform.com/docs/api_services/newsfeed/restrictions#criteria
13
+ QUALIFYING_FIELDS_FOR_NEWSFEED = %w( BathsTotal BedsTotal City CountyOrParish ListPrice Location MlsStatus
14
+ PostalCode PropertyType RoomsTotal State )
15
+
11
16
self . element_name = "savedsearches"
12
17
13
18
def initialize ( attributes = { } )
@@ -74,24 +79,13 @@ def provided_search?
74
79
false
75
80
end
76
81
77
- def self . qualifying_fields_for_newsfeed
78
- # Newsfeed restriction criteria for saved searches:
79
- # http://alpha.sparkplatform.com/docs/api_services/newsfeed/restrictions#criteria
80
- %w( BathsTotal BedsTotal City CountyOrParish ListPrice Location MlsStatus PostalCode PropertyType
81
- RoomsTotal State )
82
- end
83
-
84
- def qualifying_fields_for_newsfeed
85
- self . class . qualifying_fields_for_newsfeed
86
- end
87
-
88
82
def can_have_newsfeed?
89
83
90
84
return true if has_active_newsfeed? || has_inactive_newsfeed?
91
85
92
86
number_of_filters = 0
93
87
94
- self . class . qualifying_fields_for_newsfeed . each do |field |
88
+ QUALIFYING_FIELDS_FOR_NEWSFEED . each do |field |
95
89
number_of_filters += 1 if self . Filter . include? field
96
90
end
97
91
Original file line number Diff line number Diff line change 238
238
end
239
239
end
240
240
241
- describe "qualifying_fields_for_newsfeed " do
241
+ describe "QUALIFYING_FIELDS_FOR_NEWSFEED " do
242
242
it "should return an array" do
243
- subject . class . qualifying_fields_for_newsfeed . should be_an ( Array )
243
+ subject . class :: QUALIFYING_FIELDS_FOR_NEWSFEED . should be_an ( Array )
244
244
end
245
245
end
246
246
You can’t perform that action at this time.
0 commit comments