`AnnouncementController` -> `Admin::AnnouncementController`

This commit is contained in:
Andreas Nedbal 2022-11-20 18:58:19 +01:00 committed by Andreas Nedbal
parent 23dc8a17f9
commit 54e157ec76
7 changed files with 18 additions and 17 deletions

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
class AnnouncementController < ApplicationController
class Admin::AnnouncementController < ApplicationController
before_action :authenticate_user!
def index

View File

@ -78,6 +78,7 @@ en:
twitter: "Share on Twitter"
tumblr: "Share on Tumblr"
other: "Share on other apps..."
admin:
announcement:
index:
title: :activerecord.models.announcement.other

View File

@ -13,12 +13,12 @@ Rails.application.routes.draw do
mount PgHero::Engine, at: "/pghero", as: "pghero"
get "/admin", to: "admin/dashboard#index", as: :admin_dashboard
get "/admin/announcements", to: "announcement#index", as: :announcement_index
post "/admin/announcements", to: "announcement#create", as: :announcement_create
get "/admin/announcements/new", to: "announcement#new", as: :announcement_new
get "/admin/announcements/:id/edit", to: "announcement#edit", as: :announcement_edit
patch "/admin/announcements/:id", to: "announcement#update", as: :announcement_update
delete "/admin/announcements/:id", to: "announcement#destroy", as: :announcement_destroy
get "/admin/announcements", to: "admin/announcement#index", as: :announcement_index
post "/admin/announcements", to: "admin/announcement#create", as: :announcement_create
get "/admin/announcements/new", to: "admin/announcement#new", as: :announcement_new
get "/admin/announcements/:id/edit", to: "admin/announcement#edit", as: :announcement_edit
patch "/admin/announcements/:id", to: "admin/announcement#update", as: :announcement_update
delete "/admin/announcements/:id", to: "admin/announcement#destroy", as: :announcement_destroy
end
# Routes only accessible by moderators (moderation panel)

View File

@ -2,7 +2,7 @@
require "rails_helper"
describe AnnouncementController, type: :controller do
describe Admin::AnnouncementController, type: :controller do
let(:user) { FactoryBot.create(:user, roles: [:administrator]) }
describe "#index" do