From b446138aefb04799cc1253886335ced16e546517 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 9 May 2018 12:38:09 +0800 Subject: [PATCH] Rename trace_controller to traces_controller --- .rubocop_todo.yml | 2 +- app/controllers/api_controller.rb | 2 +- ...ace_controller.rb => traces_controller.rb} | 6 +- .../{trace => traces}/_description.html.erb | 2 +- app/views/{trace => traces}/_trace.html.erb | 4 +- .../_trace_optionals.html.erb | 0 .../_trace_paging_nav.html.erb | 0 app/views/{trace => traces}/create.html.erb | 2 +- app/views/{trace => traces}/edit.html.erb | 4 +- .../{trace => traces}/georss.rss.builder | 10 +-- app/views/{trace => traces}/list.html.erb | 4 +- app/views/{trace => traces}/offline.html.erb | 0 app/views/{trace => traces}/view.html.erb | 8 +-- app/views/user/view.html.erb | 4 +- config/locales/en.yml | 2 +- config/routes.rb | 58 +++++++-------- ...ller_test.rb => traces_controller_test.rb} | 70 +++++++++---------- 17 files changed, 89 insertions(+), 89 deletions(-) rename app/controllers/{trace_controller.rb => traces_controller.rb} (98%) rename app/views/{trace => traces}/_description.html.erb (62%) rename app/views/{trace => traces}/_trace.html.erb (74%) rename app/views/{trace => traces}/_trace_optionals.html.erb (100%) rename app/views/{trace => traces}/_trace_paging_nav.html.erb (100%) rename app/views/{trace => traces}/create.html.erb (84%) rename app/views/{trace => traces}/edit.html.erb (82%) rename app/views/{trace => traces}/georss.rss.builder (67%) rename app/views/{trace => traces}/list.html.erb (89%) rename app/views/{trace => traces}/offline.html.erb (100%) rename app/views/{trace => traces}/view.html.erb (81%) rename test/controllers/{trace_controller_test.rb => traces_controller_test.rb} (94%) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index cdac8fd67..6bff1b098 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -33,7 +33,7 @@ Lint/AssignmentInCondition: - 'app/controllers/application_controller.rb' - 'app/controllers/geocoder_controller.rb' - 'app/controllers/notes_controller.rb' - - 'app/controllers/trace_controller.rb' + - 'app/controllers/traces_controller.rb' - 'app/controllers/user_controller.rb' - 'app/controllers/user_preferences_controller.rb' - 'app/helpers/application_helper.rb' diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index f9b48cb1c..021ada0cd 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -67,7 +67,7 @@ class ApiController < ApplicationController if gpx_file.identifiable? track << (XML::Node.new("name") << gpx_file.name) track << (XML::Node.new("desc") << gpx_file.description) - track << (XML::Node.new("url") << url_for(:controller => "trace", :action => "view", :display_name => gpx_file.user.display_name, :id => gpx_file.id)) + track << (XML::Node.new("url") << url_for(:controller => "traces", :action => "view", :display_name => gpx_file.user.display_name, :id => gpx_file.id)) end else # use the anonymous track segment if the user hasn't allowed diff --git a/app/controllers/trace_controller.rb b/app/controllers/traces_controller.rb similarity index 98% rename from app/controllers/trace_controller.rb rename to app/controllers/traces_controller.rb index 5eb9a0ff7..86de77706 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/traces_controller.rb @@ -1,4 +1,4 @@ -class TraceController < ApplicationController +class TracesController < ApplicationController layout "site", :except => :georss skip_before_action :verify_authenticity_token, :only => [:api_create, :api_read, :api_update, :api_delete, :api_data] @@ -167,7 +167,7 @@ class TraceController < ApplicationController elsif current_user.nil? || @trace.user != current_user head :forbidden else - @title = t "trace.edit.title", :name => @trace.name + @title = t ".title", :name => @trace.name if request.post? && params[:trace] @trace.description = params[:trace][:description] @@ -384,7 +384,7 @@ class TraceController < ApplicationController end def offline_warning - flash.now[:warning] = t "trace.offline_warning.message" if STATUS == :gpx_offline + flash.now[:warning] = t "traces.offline_warning.message" if STATUS == :gpx_offline end def offline_redirect diff --git a/app/views/trace/_description.html.erb b/app/views/traces/_description.html.erb similarity index 62% rename from app/views/trace/_description.html.erb rename to app/views/traces/_description.html.erb index 30abbaba6..f4edc0e21 100644 --- a/app/views/trace/_description.html.erb +++ b/app/views/traces/_description.html.erb @@ -1,4 +1,4 @@ -<%= image_tag(url_for(:controller => :trace, :action => :icon, :id => description.id, :display_name => description.user.display_name)) %> +<%= image_tag(url_for(:controller => :traces, :action => :icon, :id => description.id, :display_name => description.user.display_name)) %> <% if description.size -%> <%= t ".description_with_count", :count => description.size, :user => description.user.display_name %> <% else -%> diff --git a/app/views/trace/_trace.html.erb b/app/views/traces/_trace.html.erb similarity index 74% rename from app/views/trace/_trace.html.erb rename to app/views/traces/_trace.html.erb index 0847ddaf1..9b8b16a63 100644 --- a/app/views/trace/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -3,13 +3,13 @@ <% if STATUS != :gpx_offline %> <% if trace.inserted %> - + <% else %> <%= t '.pending' %> <% end %> <% end %> - <%= link_to trace.name, {:controller => 'trace', :action => 'view', :display_name => trace.user.display_name, :id => trace.id} %> + <%= link_to trace.name, { :controller => 'traces', :action => 'view', :display_name => trace.user.display_name, :id => trace.id } %> ... <% if trace.inserted %> (<%= t '.count_points', :count => trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/,'\1,') %>) diff --git a/app/views/trace/_trace_optionals.html.erb b/app/views/traces/_trace_optionals.html.erb similarity index 100% rename from app/views/trace/_trace_optionals.html.erb rename to app/views/traces/_trace_optionals.html.erb diff --git a/app/views/trace/_trace_paging_nav.html.erb b/app/views/traces/_trace_paging_nav.html.erb similarity index 100% rename from app/views/trace/_trace_paging_nav.html.erb rename to app/views/traces/_trace_paging_nav.html.erb diff --git a/app/views/trace/create.html.erb b/app/views/traces/create.html.erb similarity index 84% rename from app/views/trace/create.html.erb rename to app/views/traces/create.html.erb index 7e1af7862..42d9f8ab2 100644 --- a/app/views/trace/create.html.erb +++ b/app/views/traces/create.html.erb @@ -22,7 +22,7 @@
- <%= f.select :visibility, [[t('trace.visibility.private'),"private"],[t('trace.visibility.public'),"public"],[t('trace.visibility.trackable'),"trackable"],[t('trace.visibility.identifiable'),"identifiable"]] %> + <%= f.select :visibility, [[t('traces.visibility.private'),"private"],[t('traces.visibility.public'),"public"],[t('traces.visibility.trackable'),"trackable"],[t('traces.visibility.identifiable'),"identifiable"]] %> (<%= t '.visibility_help' %>)
diff --git a/app/views/trace/edit.html.erb b/app/views/traces/edit.html.erb similarity index 82% rename from app/views/trace/edit.html.erb rename to app/views/traces/edit.html.erb index e890745ae..6657a33ad 100644 --- a/app/views/trace/edit.html.erb +++ b/app/views/traces/edit.html.erb @@ -2,7 +2,7 @@

<%= t '.heading', :name => h(@trace.name) %>

<% end %> - + <%= form_for @trace, :method => :post, :url => { :action => "edit" } do |f| %> @@ -44,7 +44,7 @@
- <%= f.select :visibility, [[t('trace.visibility.private'),"private"], [t('trace.visibility.public'),"public"], [t('trace.visibility.trackable'),"trackable"], [t('trace.visibility.identifiable'),"identifiable"]] %> (<%= t '.visibility_help' %>) + <%= f.select :visibility, [[t('traces.visibility.private'),"private"], [t('traces.visibility.public'),"public"], [t('traces.visibility.trackable'),"trackable"], [t('traces.visibility.identifiable'),"identifiable"]] %> (<%= t '.visibility_help' %>)
diff --git a/app/views/trace/georss.rss.builder b/app/views/traces/georss.rss.builder similarity index 67% rename from app/views/trace/georss.rss.builder rename to app/views/traces/georss.rss.builder index 984284174..66dad596d 100644 --- a/app/views/trace/georss.rss.builder +++ b/app/views/traces/georss.rss.builder @@ -7,22 +7,22 @@ xml.rss("version" => "2.0", xml.channel do xml.title t(".title") xml.description t(".title") - xml.link url_for(:controller => :trace, :action => :list, :only_path => false) + xml.link url_for(:controller => :traces, :action => :list, :only_path => false) xml.image do xml.url image_url("mag_map-rss2.0.png") - xml.title t("trace.georss.title") + xml.title t(".title") xml.width 100 xml.height 100 - xml.link url_for(:controller => :trace, :action => :list, :only_path => false) + xml.link url_for(:controller => :traces, :action => :list, :only_path => false) end @traces.each do |trace| xml.item do xml.title trace.name - xml.link url_for(:controller => :trace, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false) - xml.guid url_for(:controller => :trace, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false) + xml.link url_for(:controller => :traces, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false) + xml.guid url_for(:controller => :traces, :action => :view, :id => trace.id, :display_name => trace.user.display_name, :only_path => false) xml.description do xml.cdata! render(:partial => "description", :object => trace, :formats => [:html]) diff --git a/app/views/trace/list.html.erb b/app/views/traces/list.html.erb similarity index 89% rename from app/views/trace/list.html.erb rename to app/views/traces/list.html.erb index b560c2ad3..4c433ce66 100644 --- a/app/views/trace/list.html.erb +++ b/app/views/traces/list.html.erb @@ -5,11 +5,11 @@
  • <%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
  • <%= link_to t('.upload_trace'), :action => 'create' %>
  • <% if @tag %> -
  • <%= link_to t('.see_all_traces'), :controller => 'trace', :action => 'list', :display_name => nil, :tag => nil, :page => nil %>
  • +
  • <%= link_to t('.see_all_traces'), :controller => 'traces', :action => 'list', :display_name => nil, :tag => nil, :page => nil %>
  • <%= link_to t('.see_my_traces'), :action => 'mine', :tag => nil, :page => nil %>
  • <% else %> <% if @display_name %> -
  • <%= link_to t('.see_all_traces'), :controller => 'trace', :action => 'list', :display_name => nil, :tag => nil, :page => nil %>
  • +
  • <%= link_to t('.see_all_traces'), :controller => 'traces', :action => 'list', :display_name => nil, :tag => nil, :page => nil %>
  • <% end %> <%= unless_user(@target_user, :li) do %> <%= link_to t('.see_my_traces'), :action => 'mine', :tag => nil, :page => nil %> diff --git a/app/views/trace/offline.html.erb b/app/views/traces/offline.html.erb similarity index 100% rename from app/views/trace/offline.html.erb rename to app/views/traces/offline.html.erb diff --git a/app/views/trace/view.html.erb b/app/views/traces/view.html.erb similarity index 81% rename from app/views/trace/view.html.erb rename to app/views/traces/view.html.erb index 2330edddf..9566e6be8 100644 --- a/app/views/trace/view.html.erb +++ b/app/views/traces/view.html.erb @@ -4,7 +4,7 @@ <% if STATUS != :gpx_offline %> <% if @trace.inserted %> - + <% else %> <%= t '.pending' %> <% end %> @@ -40,7 +40,7 @@ <%= t '.tags' %> <% unless @trace.tags.empty? %> - <%= raw(@trace.tags.collect { |tag| link_to tag.tag, { :controller => 'trace', :action => 'list', :tag => tag.tag, :id => nil } }.join(", ")) %> + <%= raw(@trace.tags.collect { |tag| link_to tag.tag, { :controller => 'traces', :action => 'list', :tag => tag.tag, :id => nil } }.join(", ")) %> <% else %> <%= t '.none' %> <% end %> @@ -48,7 +48,7 @@ <%= t '.visibility' %> - <%= t "trace.visibility.#{@trace.visibility}" %> + <%= t "traces.visibility.#{@trace.visibility}" %> @@ -59,6 +59,6 @@ <%= if_user(@trace.user) do %> <%= button_to t('.edit_track'), trace_edit_path(@trace) %> <% end %> - <%= button_to t('.delete_track'), { :controller => 'trace', :action => 'delete', :id => @trace.id }, :data => { :confirm => t('.confirm_delete') } %> + <%= button_to t('.delete_track'), { :controller => 'traces', :action => 'delete', :id => @trace.id }, :data => { :confirm => t('.confirm_delete') } %> <% end %> diff --git a/app/views/user/view.html.erb b/app/views/user/view.html.erb index bc70545f5..f794b5e71 100644 --- a/app/views/user/view.html.erb +++ b/app/views/user/view.html.erb @@ -14,7 +14,7 @@ <%= link_to t('.my notes'), :controller => 'notes', :action=> 'mine' %>
  • - <%= link_to t('.my traces'), :controller => 'trace', :action=>'mine' %> + <%= link_to t('.my traces'), :controller => 'traces', :action => 'mine' %> <%= number_with_delimiter(current_user.traces.size) %>
  • @@ -56,7 +56,7 @@ <%= link_to t('.notes'), :controller => 'notes', :action=> 'mine' %>
  • - <%= link_to t('.traces'), :controller => 'trace', :action => 'list', :display_name => @user.display_name %> + <%= link_to t('.traces'), :controller => 'traces', :action => 'list', :display_name => @user.display_name %> <%= number_with_delimiter(@user.traces.size) %>
  • diff --git a/config/locales/en.yml b/config/locales/en.yml index 1a1aa83b8..06f8bc928 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1569,7 +1569,7 @@ en: Just go to the map and click the note icon: . This will add a marker to the map, which you can move by dragging. Add your message, then click save, and other mappers will investigate. - trace: + traces: visibility: private: "Private (only shared as anonymous, unordered points)" public: "Public (shown in trace list and as anonymous, unordered points)" diff --git a/config/routes.rb b/config/routes.rb index 67deae7ed..2d47210fb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -74,12 +74,12 @@ OpenStreetMap::Application.routes.draw do put "user/preferences/:preference_key" => "user_preferences#update_one" delete "user/preferences/:preference_key" => "user_preferences#delete_one" - post "gpx/create" => "trace#api_create" - get "gpx/:id" => "trace#api_read", :id => /\d+/ - put "gpx/:id" => "trace#api_update", :id => /\d+/ - delete "gpx/:id" => "trace#api_delete", :id => /\d+/ - get "gpx/:id/details" => "trace#api_read", :id => /\d+/ - get "gpx/:id/data" => "trace#api_data" + post "gpx/create" => "traces#api_create" + get "gpx/:id" => "traces#api_read", :id => /\d+/ + put "gpx/:id" => "traces#api_update", :id => /\d+/ + delete "gpx/:id" => "traces#api_delete", :id => /\d+/ + get "gpx/:id/details" => "traces#api_read", :id => /\d+/ + get "gpx/:id/data" => "traces#api_data" # AMF (ActionScript) API post "amf/read" => "amf#amf_read" @@ -188,29 +188,29 @@ OpenStreetMap::Application.routes.draw do post "/preview/:type" => "site#preview", :as => :preview # traces - get "/user/:display_name/traces/tag/:tag/page/:page" => "trace#list", :page => /[1-9][0-9]*/ - get "/user/:display_name/traces/tag/:tag" => "trace#list" - get "/user/:display_name/traces/page/:page" => "trace#list", :page => /[1-9][0-9]*/ - get "/user/:display_name/traces" => "trace#list" - get "/user/:display_name/traces/tag/:tag/rss" => "trace#georss", :defaults => { :format => :rss } - get "/user/:display_name/traces/rss" => "trace#georss", :defaults => { :format => :rss } - get "/user/:display_name/traces/:id" => "trace#view" - get "/user/:display_name/traces/:id/picture" => "trace#picture" - get "/user/:display_name/traces/:id/icon" => "trace#icon" - get "/traces/tag/:tag/page/:page" => "trace#list", :page => /[1-9][0-9]*/ - get "/traces/tag/:tag" => "trace#list" - get "/traces/page/:page" => "trace#list", :page => /[1-9][0-9]*/ - get "/traces" => "trace#list" - get "/traces/tag/:tag/rss" => "trace#georss", :defaults => { :format => :rss } - get "/traces/rss" => "trace#georss", :defaults => { :format => :rss } - get "/traces/mine/tag/:tag/page/:page" => "trace#mine", :page => /[1-9][0-9]*/ - get "/traces/mine/tag/:tag" => "trace#mine" - get "/traces/mine/page/:page" => "trace#mine" - get "/traces/mine" => "trace#mine" - match "/trace/create" => "trace#create", :via => [:get, :post] - get "/trace/:id/data" => "trace#data", :id => /\d+/, :as => "trace_data" - match "/trace/:id/edit" => "trace#edit", :via => [:get, :post], :id => /\d+/, :as => "trace_edit" - post "/trace/:id/delete" => "trace#delete", :id => /\d+/ + get "/user/:display_name/traces/tag/:tag/page/:page" => "traces#list", :page => /[1-9][0-9]*/ + get "/user/:display_name/traces/tag/:tag" => "traces#list" + get "/user/:display_name/traces/page/:page" => "traces#list", :page => /[1-9][0-9]*/ + get "/user/:display_name/traces" => "traces#list" + get "/user/:display_name/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss } + get "/user/:display_name/traces/rss" => "traces#georss", :defaults => { :format => :rss } + get "/user/:display_name/traces/:id" => "traces#view" + get "/user/:display_name/traces/:id/picture" => "traces#picture" + get "/user/:display_name/traces/:id/icon" => "traces#icon" + get "/traces/tag/:tag/page/:page" => "traces#list", :page => /[1-9][0-9]*/ + get "/traces/tag/:tag" => "traces#list" + get "/traces/page/:page" => "traces#list", :page => /[1-9][0-9]*/ + get "/traces" => "traces#list" + get "/traces/tag/:tag/rss" => "traces#georss", :defaults => { :format => :rss } + get "/traces/rss" => "traces#georss", :defaults => { :format => :rss } + get "/traces/mine/tag/:tag/page/:page" => "traces#mine", :page => /[1-9][0-9]*/ + get "/traces/mine/tag/:tag" => "traces#mine" + get "/traces/mine/page/:page" => "traces#mine" + get "/traces/mine" => "traces#mine" + match "/trace/create" => "traces#create", :via => [:get, :post] + get "/trace/:id/data" => "traces#data", :id => /\d+/, :as => "trace_data" + match "/trace/:id/edit" => "traces#edit", :via => [:get, :post], :id => /\d+/, :as => "trace_edit" + post "/trace/:id/delete" => "traces#delete", :id => /\d+/ # diary pages match "/diary/new" => "diary_entry#new", :via => [:get, :post] diff --git a/test/controllers/trace_controller_test.rb b/test/controllers/traces_controller_test.rb similarity index 94% rename from test/controllers/trace_controller_test.rb rename to test/controllers/traces_controller_test.rb index 23a2e5261..9600ff77e 100644 --- a/test/controllers/trace_controller_test.rb +++ b/test/controllers/traces_controller_test.rb @@ -2,7 +2,7 @@ require "test_helper" require "digest" require "minitest/mock" -class TraceControllerTest < ActionController::TestCase +class TracesControllerTest < ActionController::TestCase def setup @gpx_trace_dir = Object.send("remove_const", "GPX_TRACE_DIR") Object.const_set("GPX_TRACE_DIR", Rails.root.join("test", "gpx", "traces")) @@ -27,140 +27,140 @@ class TraceControllerTest < ActionController::TestCase def test_routes assert_routing( { :path => "/api/0.6/gpx/create", :method => :post }, - { :controller => "trace", :action => "api_create" } + { :controller => "traces", :action => "api_create" } ) assert_routing( { :path => "/api/0.6/gpx/1", :method => :get }, - { :controller => "trace", :action => "api_read", :id => "1" } + { :controller => "traces", :action => "api_read", :id => "1" } ) assert_routing( { :path => "/api/0.6/gpx/1", :method => :put }, - { :controller => "trace", :action => "api_update", :id => "1" } + { :controller => "traces", :action => "api_update", :id => "1" } ) assert_routing( { :path => "/api/0.6/gpx/1", :method => :delete }, - { :controller => "trace", :action => "api_delete", :id => "1" } + { :controller => "traces", :action => "api_delete", :id => "1" } ) assert_recognizes( - { :controller => "trace", :action => "api_read", :id => "1" }, + { :controller => "traces", :action => "api_read", :id => "1" }, { :path => "/api/0.6/gpx/1/details", :method => :get } ) assert_routing( { :path => "/api/0.6/gpx/1/data", :method => :get }, - { :controller => "trace", :action => "api_data", :id => "1" } + { :controller => "traces", :action => "api_data", :id => "1" } ) assert_routing( { :path => "/api/0.6/gpx/1/data.xml", :method => :get }, - { :controller => "trace", :action => "api_data", :id => "1", :format => "xml" } + { :controller => "traces", :action => "api_data", :id => "1", :format => "xml" } ) assert_routing( { :path => "/traces", :method => :get }, - { :controller => "trace", :action => "list" } + { :controller => "traces", :action => "list" } ) assert_routing( { :path => "/traces/page/1", :method => :get }, - { :controller => "trace", :action => "list", :page => "1" } + { :controller => "traces", :action => "list", :page => "1" } ) assert_routing( { :path => "/traces/tag/tagname", :method => :get }, - { :controller => "trace", :action => "list", :tag => "tagname" } + { :controller => "traces", :action => "list", :tag => "tagname" } ) assert_routing( { :path => "/traces/tag/tagname/page/1", :method => :get }, - { :controller => "trace", :action => "list", :tag => "tagname", :page => "1" } + { :controller => "traces", :action => "list", :tag => "tagname", :page => "1" } ) assert_routing( { :path => "/user/username/traces", :method => :get }, - { :controller => "trace", :action => "list", :display_name => "username" } + { :controller => "traces", :action => "list", :display_name => "username" } ) assert_routing( { :path => "/user/username/traces/page/1", :method => :get }, - { :controller => "trace", :action => "list", :display_name => "username", :page => "1" } + { :controller => "traces", :action => "list", :display_name => "username", :page => "1" } ) assert_routing( { :path => "/user/username/traces/tag/tagname", :method => :get }, - { :controller => "trace", :action => "list", :display_name => "username", :tag => "tagname" } + { :controller => "traces", :action => "list", :display_name => "username", :tag => "tagname" } ) assert_routing( { :path => "/user/username/traces/tag/tagname/page/1", :method => :get }, - { :controller => "trace", :action => "list", :display_name => "username", :tag => "tagname", :page => "1" } + { :controller => "traces", :action => "list", :display_name => "username", :tag => "tagname", :page => "1" } ) assert_routing( { :path => "/traces/mine", :method => :get }, - { :controller => "trace", :action => "mine" } + { :controller => "traces", :action => "mine" } ) assert_routing( { :path => "/traces/mine/page/1", :method => :get }, - { :controller => "trace", :action => "mine", :page => "1" } + { :controller => "traces", :action => "mine", :page => "1" } ) assert_routing( { :path => "/traces/mine/tag/tagname", :method => :get }, - { :controller => "trace", :action => "mine", :tag => "tagname" } + { :controller => "traces", :action => "mine", :tag => "tagname" } ) assert_routing( { :path => "/traces/mine/tag/tagname/page/1", :method => :get }, - { :controller => "trace", :action => "mine", :tag => "tagname", :page => "1" } + { :controller => "traces", :action => "mine", :tag => "tagname", :page => "1" } ) assert_routing( { :path => "/traces/rss", :method => :get }, - { :controller => "trace", :action => "georss", :format => :rss } + { :controller => "traces", :action => "georss", :format => :rss } ) assert_routing( { :path => "/traces/tag/tagname/rss", :method => :get }, - { :controller => "trace", :action => "georss", :tag => "tagname", :format => :rss } + { :controller => "traces", :action => "georss", :tag => "tagname", :format => :rss } ) assert_routing( { :path => "/user/username/traces/rss", :method => :get }, - { :controller => "trace", :action => "georss", :display_name => "username", :format => :rss } + { :controller => "traces", :action => "georss", :display_name => "username", :format => :rss } ) assert_routing( { :path => "/user/username/traces/tag/tagname/rss", :method => :get }, - { :controller => "trace", :action => "georss", :display_name => "username", :tag => "tagname", :format => :rss } + { :controller => "traces", :action => "georss", :display_name => "username", :tag => "tagname", :format => :rss } ) assert_routing( { :path => "/user/username/traces/1", :method => :get }, - { :controller => "trace", :action => "view", :display_name => "username", :id => "1" } + { :controller => "traces", :action => "view", :display_name => "username", :id => "1" } ) assert_routing( { :path => "/user/username/traces/1/picture", :method => :get }, - { :controller => "trace", :action => "picture", :display_name => "username", :id => "1" } + { :controller => "traces", :action => "picture", :display_name => "username", :id => "1" } ) assert_routing( { :path => "/user/username/traces/1/icon", :method => :get }, - { :controller => "trace", :action => "icon", :display_name => "username", :id => "1" } + { :controller => "traces", :action => "icon", :display_name => "username", :id => "1" } ) assert_routing( { :path => "/trace/create", :method => :get }, - { :controller => "trace", :action => "create" } + { :controller => "traces", :action => "create" } ) assert_routing( { :path => "/trace/create", :method => :post }, - { :controller => "trace", :action => "create" } + { :controller => "traces", :action => "create" } ) assert_routing( { :path => "/trace/1/data", :method => :get }, - { :controller => "trace", :action => "data", :id => "1" } + { :controller => "traces", :action => "data", :id => "1" } ) assert_routing( { :path => "/trace/1/data.xml", :method => :get }, - { :controller => "trace", :action => "data", :id => "1", :format => "xml" } + { :controller => "traces", :action => "data", :id => "1", :format => "xml" } ) assert_routing( { :path => "/trace/1/edit", :method => :get }, - { :controller => "trace", :action => "edit", :id => "1" } + { :controller => "traces", :action => "edit", :id => "1" } ) assert_routing( { :path => "/trace/1/edit", :method => :post }, - { :controller => "trace", :action => "edit", :id => "1" } + { :controller => "traces", :action => "edit", :id => "1" } ) assert_routing( { :path => "/trace/1/delete", :method => :post }, - { :controller => "trace", :action => "delete", :id => "1" } + { :controller => "traces", :action => "delete", :id => "1" } ) end @@ -214,7 +214,7 @@ class TraceControllerTest < ActionController::TestCase # Now try when logged in get :mine, :session => { :user => user } - assert_redirected_to :controller => "trace", :action => "list", :display_name => user.display_name + assert_redirected_to :action => "list", :display_name => user.display_name # Fetch the actual list get :list, :params => { :display_name => user.display_name }, :session => { :user => user } -- 2.39.5