Use singular route

Even simpler
parent dbc60e7f
class Admin::EmailsController < Admin::ApplicationController class Admin::EmailsController < Admin::ApplicationController
def index def show
render text: 'hello world', layout: nil render text: 'hello world'
end end
end end
...@@ -86,7 +86,7 @@ Gitlab::Application.routes.draw do ...@@ -86,7 +86,7 @@ Gitlab::Application.routes.draw do
resources :broadcast_messages, only: [:index, :create, :destroy] resources :broadcast_messages, only: [:index, :create, :destroy]
resource :logs, only: [:show] resource :logs, only: [:show]
resource :background_jobs, controller: 'background_jobs', only: [:show] resource :background_jobs, controller: 'background_jobs', only: [:show]
resources :emails, only: [:index] resource :email, only: [:show]
resources :projects, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }, only: [:index, :show] do resources :projects, constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }, only: [:index, :show] do
member do member do
......
...@@ -170,7 +170,7 @@ module SharedPaths ...@@ -170,7 +170,7 @@ module SharedPaths
end end
step 'I visit admin email page' do step 'I visit admin email page' do
visit admin_emails_path visit admin_email_path
end end
# ---------------------------------------- # ----------------------------------------
# Generic Project # Generic Project
......
...@@ -120,7 +120,7 @@ describe Admin::DashboardController, "routing" do ...@@ -120,7 +120,7 @@ describe Admin::DashboardController, "routing" do
end end
describe Admin::EmailsController, "routing" do describe Admin::EmailsController, "routing" do
it "to #index" do it "to #show" do
get("/admin/emails").should route_to('admin/emails#index') get("/admin/email").should route_to('admin/emails#show')
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment