File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,14 @@ def layouts(print_config)
20
20
end
21
21
end
22
22
23
+ # returns capabilities document for the given print config,
24
+ # nil if no print_config is given or no capabilities were found for it.
23
25
def get_capabilities ( print_config )
26
+ return unless print_config
24
27
str = URI . escape ( print_config )
25
28
r = HTTParty . get "#{ @host } /print/#{ str } /capabilities.json"
26
29
if r . success?
27
- JSON . parse r . body
28
- else
29
- :not_found
30
+ return JSON . parse r . body
30
31
end
31
32
end
32
33
Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ class MapfishTest < ActionDispatch::IntegrationTest
23
23
assert configs . include? ( "DEMO_gtt" )
24
24
end
25
25
26
+ test "should handle nil print config" do
27
+ assert_nil @mapfish . layouts nil
28
+ end
29
+
26
30
test "should have layouts for print config" do
27
31
assert layouts = @mapfish . layouts ( "DEMO_gtt" )
28
32
assert_equal Array , layouts . class
You can’t perform that action at this time.
0 commit comments