1 require File.dirname(__FILE__) + '/../spec_helper'
4 def self.included(klass)
5 klass.extend(ClassMethods)
8 def boundary_params(key)
11 '-0.3565352711206896,51.464740877658045,-0.2686446461206896,51.508686190158045'
12 when :min_lat_more_than_max_lat
13 '-0.3565352711206896,51.508686190158045,-0.2686446461206896,51.464740877658045'
14 when :min_lon_more_than_max_lon
15 '51.464740877658045,-0.2686446461206896,51.508686190158045,-0.3565352711206896'
25 describe "When accessing /api/0.5/map" do
32 it "should _return success_ with _correct boundary longitudes/latitudes_" do
33 get :map, :bbox => boundary_params(:valid)
34 response.should be_success
37 it "should return an _error_ when _minimum longitude more than or equal to maximum longitude_" do
38 get :map, :bbox => boundary_params(:min_lat_more_than_max_lat)
39 response.should_not be_success
42 it "should return an error unless minimum latitude less than maximum latitude" do
43 get :map, :bbox => boundary_params(:min_lon_more_than_max_lon)
44 response.should_not be_success
47 it "should return an error unless latitudes are between -90 and 90 degrees" do
51 it "should return an error unless longitudes are between -180 and 180 degrees" do