fix tests

This commit is contained in:
r888888888
2017-04-04 12:25:03 -07:00
parent 347ffb5989
commit 0b8d4105aa
19 changed files with 111 additions and 162 deletions

View File

@@ -1,7 +1,12 @@
require 'test_helper'
require 'helpers/post_archive_test_helper'
class ReportsControllerTest < ActionController::TestCase
setup do
include PostArchiveTestHelper
def setup
super
CurrentUser.user = FactoryGirl.create(:mod_user)
CurrentUser.ip_addr = "127.0.0.1"
session[:user_id] = CurrentUser.user.id
@@ -10,34 +15,15 @@ class ReportsControllerTest < ActionController::TestCase
@posts = @users.map { |u| FactoryGirl.create(:post, uploader: u) }
end
teardown do
def teardown
super
CurrentUser.user = nil
CurrentUser.ip_addr = nil
session[:user_id] = nil
end
context "The reports controller" do
context "user_promotions action" do
should "render" do
get :user_promotions
assert_response :success
end
end
context "janitor_trials action" do
should "render" do
get :janitor_trials
assert_response :success
end
end
context "contributors action" do
should "render" do
get :contributors
assert_response :success
end
end
context "uploads action" do
should "render" do
get :uploads
@@ -58,12 +44,5 @@ class ReportsControllerTest < ActionController::TestCase
assert_response :success
end
end
context "post_versions_create action" do
should "render" do
#post :post_versions_create, { tag: "touhou", type: "added" }
#assert_response :success
end
end
end
end