tests: add misc controller tests.
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
module Admin
|
module Admin
|
||||||
class DashboardsController < ApplicationController
|
class DashboardsController < ApplicationController
|
||||||
before_filter :admin_only
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@dashboard = AdminDashboard.new
|
@dashboard = AdminDashboard.new
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ class AdminDashboard
|
|||||||
end
|
end
|
||||||
|
|
||||||
def forum_topics
|
def forum_topics
|
||||||
ForumTopic.where(category_id: 1).order("id desc").limit(20)
|
ForumTopic.search(category_id: 1).order("id desc").limit(20)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
12
test/functional/admin/dashboards_controller_test.rb
Normal file
12
test/functional/admin/dashboards_controller_test.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class Admin::DashboardsControllerTest < ActionController::TestCase
|
||||||
|
context "The admin dashboard controller" do
|
||||||
|
context "show action" do
|
||||||
|
should "render" do
|
||||||
|
get :show
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class ArtistCommentaryVersionsControllerTest < ActionController::TestCase
|
||||||
|
context "The artist commentary versions controller" do
|
||||||
|
context "index action" do
|
||||||
|
should "render" do
|
||||||
|
get :index
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
12
test/functional/counts_controller_test.rb
Normal file
12
test/functional/counts_controller_test.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class CountsControllerTest < ActionController::TestCase
|
||||||
|
context "The counts commentary controller" do
|
||||||
|
context "posts action" do
|
||||||
|
should "render" do
|
||||||
|
get :posts
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
12
test/functional/delayed_jobs_controller_test.rb
Normal file
12
test/functional/delayed_jobs_controller_test.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class DelayedJobsControllerTest < ActionController::TestCase
|
||||||
|
context "The delayed jobs controller" do
|
||||||
|
context "index action" do
|
||||||
|
should "render" do
|
||||||
|
get :index
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
12
test/functional/dtext_previews_controller_test.rb
Normal file
12
test/functional/dtext_previews_controller_test.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class DtextPreviewsControllerTest < ActionController::TestCase
|
||||||
|
context "The dtext previews controller" do
|
||||||
|
context "create action" do
|
||||||
|
should "render" do
|
||||||
|
post :create, { body: "h1. Touhou\n\n* [[touhou]]" }
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user