mirror of
https://github.com/publiclab/mapknitter.git
synced 2025-12-05 16:00:00 +01:00
* Search maps by location * mend * Search by location -2 * Error fixed * routes updated * Naming changed * Changes fixed * Like operation fixed * Error 500 solved * Test added
50 lines
1.0 KiB
Ruby
50 lines
1.0 KiB
Ruby
require 'test_helper'
|
|
|
|
class FrontUiControllerTest < ActionController::TestCase
|
|
|
|
def setup
|
|
@map = maps(:saugus)
|
|
end
|
|
|
|
def teardown
|
|
end
|
|
|
|
test 'should display image url for maps by region' do
|
|
get :index
|
|
assert_response :success
|
|
assert assigns(:mappers)
|
|
assert assigns(:maps)
|
|
assert_template 'front_ui/index'
|
|
end
|
|
|
|
test 'gallery page' do
|
|
get :gallery
|
|
|
|
assert assigns(:maps)
|
|
assert assigns(:authors)
|
|
assert_response :success
|
|
assert_template 'front_ui/gallery'
|
|
end
|
|
|
|
test 'nearby mappers' do
|
|
session[:lat] = -1.2920
|
|
session[:lon] = 36.8219
|
|
|
|
get :nearby_mappers
|
|
assert_response :success
|
|
assert assigns(:nearby_maps)
|
|
assert assigns(:nearby_mappers)
|
|
assert_template 'front_ui/nearby_mappers'
|
|
end
|
|
|
|
test 'search map by location' do
|
|
get :location, params: { loc: 'India'}, xhr: true
|
|
@maps = assigns(:maps)
|
|
|
|
assert_response :success
|
|
assert !@maps.collect(&:name).include?('Saugus Landfill Incinerator')
|
|
assert @maps.collect(&:name).include?('Cubbon Park')
|
|
end
|
|
|
|
end
|