+ <%= link_to admin_faq_path(faq) do %>
+
+ <% end %>
+ <%= link_to edit_admin_faq_path(faq) do %>
+
+ <% end %>
+ <%= link_to admin_faq_path(faq), method: :delete,
+ data: { confirm: 'The FAQ entry is going to be destroyed' } do %>
+
+ <% end %>
+
<% end %>
+ <%= content_tag(:li, active_class(admin_faqs_path)) do %>
+ <%= link_to 'FAQ', admin_faqs_path %>
+ <% end %>
<%= content_tag(:li, active_class(admin_pools_path)) do %>
<%= link_to 'Pools', admin_pools_path %>
<% end %>
<%= content_tag(:li, active_class(admin_settings_path)) do %>
<%= link_to 'Settings', admin_settings_path %>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index d8ececa..6c4f625 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,103 +1,105 @@
Rails.application.routes.draw do
root 'application#index'
post 'grnet' => 'application#grnet'
get 'institutional' => 'application#institutional'
match 'vima', to: 'application#vima', :via => [:get, :post]
get 'logout' => 'application#logout'
resources :clients, only: [:index, :show] do
member do
get :jobs
get :logs
get :stats
post :stats
get :users
get :restore
post :run_restore
post :restore_selected
delete :remove_user
end
collection do
post :index
end
end
resources :clients, only: [], param: :client_id do
member do
get :tree
end
end
resources :invitations, only: [:create]
get '/invitations/:host_id/:verification_code/accept' => 'invitations#accept',
as: :accept_invitation
resources :hosts, only: [:new, :create, :show, :edit, :update, :destroy] do
member do
post :submit_config
post :disable
delete :revoke
end
collection do
get :fetch_vima_hosts, to: 'hosts#fetch_vima_hosts', as: :fetch_vima
end
resources :jobs, only: [:new, :create, :show, :edit, :update, :destroy] do
member do
patch :toggle_enable
post :backup_now
end
end
resources :filesets, only: [:show, :new, :create, :edit, :update, :destroy]
resources :schedules, only: [:show, :new, :edit, :create, :update, :destroy]
end
namespace :admin do
match '/', to: 'base#index', via: [:get, :post]
get '/login' => 'base#login', as: :login
resources :settings, only: [:index, :new, :create, :edit, :update] do
member do
delete :reset
end
end
resources :clients, only: [:index, :show] do
member do
get :jobs
get :logs
get :stats
post :stats
get :configuration
post :disable
post :block
post :unblock
delete :revoke
end
end
resources :hosts, only: [] do
collection do
get :unverified
end
member do
post :verify
end
end
resources :users, only: [:index, :new, :create, :show, :edit, :update] do
member do
patch :ban
patch :unban
end
end
resources :pools, only: [:index, :new, :create]
+
+ resources :faqs
end
end
diff --git a/spec/routing/admin/faq_routing_spec.rb b/spec/routing/admin/faq_routing_spec.rb
new file mode 100644
index 0000000..5e7a2dd
--- /dev/null
+++ b/spec/routing/admin/faq_routing_spec.rb
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+describe Admin::FaqsController do
+ it 'routes GET /admin/faqs' do
+ expect(get('/admin/faqs')).to route_to(controller: 'admin/faqs', action: 'index')
+ end
+
+ it 'routes GET /admin/faqs/new' do
+ expect(get('/admin/faqs/new')).
+ to route_to(controller: 'admin/faqs', action: 'new')
+ end
+
+ it 'routes GET /admin/faqs/1' do
+ expect(get('/admin/faqs/1')).
+ to route_to(controller: 'admin/faqs', action: 'show', id: '1')
+ end
+
+ it 'routes GET /admin/faqs/1/edit' do
+ expect(get('/admin/faqs/1/edit')).
+ to route_to(controller: 'admin/faqs', action: 'edit', id: '1')
+ end
+
+ it 'routes PUT /admin/faqs/1' do
+ expect(put('/admin/faqs/1')).
+ to route_to(controller: 'admin/faqs', action: 'update', id: '1')
+ end
+
+ it 'routes POST /admin/faqs' do
+ expect(post('/admin/faqs')).
+ to route_to(controller: 'admin/faqs', action: 'create')
+ end
+
+ it 'routes DELETE /admin/faqs/1' do
+ expect(delete('/admin/faqs/1')).
+ to route_to(controller: 'admin/faqs', action: 'destroy', id: '1')
+ end
+end