The Rails convention is for test/helpers to be used for testing the view helpers in app/helpers. We were using it to store certain utility methods instead. Move these to test/test_helpers so that test/helpers can be used for its intended purpose.
46 lines
957 B
Ruby
46 lines
957 B
Ruby
require 'test_helper'
|
|
|
|
class ReportsControllerTest < ActionController::TestCase
|
|
def setup
|
|
super
|
|
|
|
CurrentUser.user = FactoryGirl.create(:mod_user)
|
|
CurrentUser.ip_addr = "127.0.0.1"
|
|
session[:user_id] = CurrentUser.user.id
|
|
|
|
@users = FactoryGirl.create_list(:contributor_user, 2)
|
|
@posts = @users.map { |u| FactoryGirl.create(:post, uploader: u) }
|
|
end
|
|
|
|
def teardown
|
|
super
|
|
|
|
CurrentUser.user = nil
|
|
CurrentUser.ip_addr = nil
|
|
session[:user_id] = nil
|
|
end
|
|
|
|
context "The reports controller" do
|
|
context "uploads action" do
|
|
should "render" do
|
|
get :uploads
|
|
assert_response :success
|
|
end
|
|
end
|
|
|
|
context "similar_users action" do
|
|
should "render" do
|
|
#get :similar_users
|
|
#assert_response :success
|
|
end
|
|
end
|
|
|
|
context "post_versions action" do
|
|
should "render" do
|
|
get :post_versions
|
|
assert_response :success
|
|
end
|
|
end
|
|
end
|
|
end
|