tests: add misc controller tests.

This commit is contained in:
evazion
2017-02-06 18:48:35 -06:00
parent 5c16e9ce48
commit d74503ae05
7 changed files with 61 additions and 3 deletions
@@ -1,7 +1,5 @@
module Admin
class DashboardsController < ApplicationController
before_filter :admin_only
def show
@dashboard = AdminDashboard.new
end
+1 -1
View File
@@ -12,6 +12,6 @@ class AdminDashboard
end
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
@@ -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
View 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
@@ -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
@@ -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