Skip to content

Commit cbaa235

Browse files
authored
Merge branch 'master' into MWEB-1864
2 parents 1575d4b + 38eec01 commit cbaa235

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.17
1+
1.4.17

lib/spark_api/models/fields.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ def self.order(property_type=nil, arguments={})
77
connection.get("#{self.path}/order#{"/"+property_type unless property_type.nil?}", arguments)
88
end
99

10+
def self.settings
11+
connection.get("#{self.path}/order/settings")
12+
end
13+
1014
end
1115
end
1216
end

spec/fixtures/fields/settings.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"D": {
3+
"Success": true,
4+
"Results": [
5+
{
6+
"ShowingInstructions": [
7+
{
8+
"Domain": "StandardFields",
9+
"Field": "ListOfficePhone",
10+
"GroupField": null
11+
},
12+
{
13+
"Domain": "CustomFields",
14+
"Field": "Vacant",
15+
"GroupField": "Property Access"
16+
}
17+
]
18+
}
19+
]
20+
}
21+
}

spec/unit/spark_api/models/fields_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,25 @@
5252
end
5353
end
5454

55+
context "/fields/order/settings", :support do
56+
on_get_it "returns the field order settings" do
57+
Fields.should respond_to(:settings)
58+
59+
# stub request
60+
stub_api_get('/fields/order/settings','fields/settings.json')
61+
62+
# request
63+
settings = subject.class.settings
64+
65+
# a standard array of results
66+
settings.should be_an(Array)
67+
settings.length.should eq(1)
68+
69+
# make sure ShowingInstructions is present
70+
settings.first.should have_key("ShowingInstructions")
71+
settings.first["ShowingInstructions"].should be_an(Array)
72+
end
73+
end
74+
5575

5676
end

0 commit comments

Comments
 (0)