include CanCan::Ability
def initialize(user)
- can :query, :browse
+ can :read, :feature_query
can :read, [Node, Way, Relation, OldNode, OldWay, OldRelation]
can [:show, :create], Note
can :search, :direction
-class BrowseController < ApplicationController
+class FeatureQueriesController < ApplicationController
layout :map_layout
before_action :authorize_web
before_action :set_locale
before_action -> { check_database_readable(:need_api => true) }
before_action :require_oauth
- before_action :update_totp, :only => [:query]
+ before_action :update_totp
around_action :web_timeout
authorize_resource :class => false
- def query; end
+ def show; end
end
telephone_link: "Call %{phone_number}"
colour_preview: "Colour %{colour_value} preview"
email_link: "Email %{email}"
- query:
+ feature_queries:
+ show:
title: "Query Features"
introduction: "Click on the map to find nearby features."
nearby: "Nearby features"
get "/offline" => "site#offline"
get "/key" => "site#key"
get "/id" => "site#id"
- get "/query" => "browse#query"
+ resource :feature_query, :path => "query", :only => :show
post "/user/:display_name/confirm/resend" => "confirmations#confirm_resend", :as => :user_confirm_resend
match "/user/:display_name/confirm" => "confirmations#confirm", :via => [:get, :post]
match "/user/confirm" => "confirmations#confirm", :via => [:get, :post]
def test_routes
assert_routing(
{ :path => "/query", :method => :get },
- { :controller => "browse", :action => "query" }
+ { :controller => "feature_queries", :action => "show" }
)
end
- def test_query
- get query_path
+ def test_show
+ get feature_query_path
assert_response :success
- assert_template "browse/query"
+ assert_template "feature_queries/show"
end
end