stubbed in blank controllers/helpers/functional tests
This commit is contained in:
8
test/functional/admin/users_controller_test.rb
Normal file
8
test/functional/admin/users_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class Admin::UsersControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/advertisements_controller_test.rb
Normal file
8
test/functional/advertisements_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class AdvertisementsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/artist_versions_controller_test.rb
Normal file
8
test/functional/artist_versions_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ArtistVersionsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/artists_controller_test.rb
Normal file
8
test/functional/artists_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ArtistsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/bans_controller_test.rb
Normal file
8
test/functional/bans_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class BansControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/comment_votes_controller_test.rb
Normal file
8
test/functional/comment_votes_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CommentVotesControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/comments_controller_test.rb
Normal file
8
test/functional/comments_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CommentsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/dmails_controller_test.rb
Normal file
8
test/functional/dmails_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class DmailsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/favorites_controller_test.rb
Normal file
8
test/functional/favorites_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class FavoritesControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/forum_posts_controller_test.rb
Normal file
8
test/functional/forum_posts_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ForumPostsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/forum_topics_controller_test.rb
Normal file
8
test/functional/forum_topics_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ForumTopicsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/janitor_trials_controller_test.rb
Normal file
8
test/functional/janitor_trials_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class JanitorTrialsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/jobs_controller_test.rb
Normal file
8
test/functional/jobs_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class JobsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/notes_controller_test.rb
Normal file
8
test/functional/notes_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class NotesControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/pool_versions_controller_test.rb
Normal file
8
test/functional/pool_versions_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PoolVersionsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/pools_controller_test.rb
Normal file
8
test/functional/pools_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PoolsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
90
test/functional/post_controller_test.rb
Normal file
90
test/functional/post_controller_test.rb
Normal file
@@ -0,0 +1,90 @@
|
||||
require File.join(File.dirname(__FILE__), %w(.. test_helper))
|
||||
|
||||
class PostControllerTest < ActionController::TestCase
|
||||
context "A post controller" do
|
||||
setup do
|
||||
@users = {}
|
||||
@users[:anon] = AnonymousUser.new
|
||||
@users[:member] = Factory.create(:user)
|
||||
@users[:banned] = Factory.create(:banned_user)
|
||||
@users[:priv] = Factory.create(:privileged_user)
|
||||
@users[:contrib] = Factory.create(:contributor_user)
|
||||
@users[:janitor] = Factory.create(:janitor_user)
|
||||
@users[:mod] = Factory.create(:moderator_user)
|
||||
@users[:admin] = Factory.create(:admin_user)
|
||||
end
|
||||
|
||||
teardown do
|
||||
@users = nil
|
||||
end
|
||||
|
||||
should "display the new post page" do
|
||||
assert_authentication_fails(:new, :get, :anon)
|
||||
assert_authentication_passes(:new, :get, :member)
|
||||
end
|
||||
|
||||
should "create a post" do
|
||||
post :create, {:post => {:source => "", :file => upload_jpeg("#{Rails.root}/test/files/test.jpg"), :tag_string => "hoge", :rating => "s"}}, {:user_id => @users[:member].id}
|
||||
p = Post.last
|
||||
assert_equal("hoge", p.tag_string)
|
||||
assert_equal("jpg", p.file_ext)
|
||||
assert_equal("s", p.rating)
|
||||
assert_equal("uploader:#{@users[:member].name}", p.uploader_string)
|
||||
assert_equal(true, File.exists?(p.file_path))
|
||||
assert_equal(true, File.exists?(p.preview_path))
|
||||
end
|
||||
|
||||
should "update a post" do
|
||||
p1 = create_post("hoge")
|
||||
|
||||
put :update, {:post => {:tags => "moge", :rating => "Explicit"}, :id => p1.id}, {:user_id => 3}
|
||||
p1.reload
|
||||
assert_equal("moge", p1.cached_tags)
|
||||
assert_equal("e", p1.rating)
|
||||
|
||||
assert_equal(2, p1.tag_history.size)
|
||||
post :update, {:post => {:rating => "Safe"}, :id => p1.id}, {:user_id => 3}
|
||||
assert_equal(3, p1.tag_history.size)
|
||||
|
||||
p1.update_attribute(:is_rating_locked, true)
|
||||
post :update, {:post => {:rating => "Questionable"}, :id => p1.id}, {:user_id => 3}
|
||||
p1.reload
|
||||
assert_equal("s", p1.rating)
|
||||
end
|
||||
|
||||
should "list posts" do
|
||||
get :index, {}, {:user_id => 3}
|
||||
assert_response :success
|
||||
|
||||
get :index, {:tags => "tag1"}, {:user_id => 3}
|
||||
assert_response :success
|
||||
|
||||
get :index, {:format => "json"}, {:user_id => 3}
|
||||
assert_response :success
|
||||
|
||||
get :index, {:format => "xml"}, {:user_id => 3}
|
||||
assert_response :success
|
||||
|
||||
get :index, {:tags => "-tag1"}, {:user_id => 3}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "list posts through an atom feed" do
|
||||
get :atom, {}, {:user_id => 3}
|
||||
assert_response :success
|
||||
|
||||
get :atom, {:tags => "tag1"}, {:user_id => 3}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "display a post" do
|
||||
get :show, {:id => 1}, {:user_id => 3}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
def test_popular
|
||||
get :popular_by_day, {}, {:user_id => 3}
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
37
test/functional/post_moderation_detail_controller_test.rb
Normal file
37
test/functional/post_moderation_detail_controller_test.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
require File.join(File.dirname(__FILE__), %w(.. test_helper))
|
||||
|
||||
class PostModerationDetailControllerTest < ActionController::TestCase
|
||||
context "A post moderation detail controller" do
|
||||
should "" do
|
||||
ModQueuePost.destroy_all
|
||||
|
||||
p1 = create_post("hoge", :status => "pending")
|
||||
p2 = create_post("hoge", :status => "active")
|
||||
p3 = create_post("moge", :status => "active")
|
||||
|
||||
p2.flag!("sage", User.find(1))
|
||||
p2.reload
|
||||
assert_not_nil(p2.flag_detail)
|
||||
|
||||
get :moderate, {}, {:user_id => 1}
|
||||
assert_response :success
|
||||
|
||||
get :moderate, {:query => "moge"}, {:user_id => 1}
|
||||
assert_response :success
|
||||
|
||||
post :moderate, {:id => p1.id, :commit => "Approve"}, {:user_id => 1}
|
||||
p1.reload
|
||||
assert_equal("active", p1.status)
|
||||
|
||||
post :moderate, {:id => p3.id, :reason => "sage", :commit => "Delete"}, {:user_id => 1}
|
||||
p3.reload
|
||||
assert_equal("deleted", p3.status)
|
||||
assert_not_nil(p3.flag_detail)
|
||||
assert_equal("sage", p3.flag_detail.reason)
|
||||
|
||||
assert_equal(0, ModQueuePost.count)
|
||||
post :moderate, {:id => "3", :commit => "Hide"}, {:user_id => 1}
|
||||
assert_equal(1, ModQueuePost.count)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PostModerationDetailsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/post_versions_controller_test.rb
Normal file
8
test/functional/post_versions_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PostVersionsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/post_votes_controller_test.rb
Normal file
8
test/functional/post_votes_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PostVotesControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/sessions_controller_test.rb
Normal file
8
test/functional/sessions_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SessionsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/tag_aliases_controller_test.rb
Normal file
8
test/functional/tag_aliases_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TagAliasesControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/tag_implications_controller_test.rb
Normal file
8
test/functional/tag_implications_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TagImplicationsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/tag_subscriptions_controller_test.rb
Normal file
8
test/functional/tag_subscriptions_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TagSubscriptionsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/tags_controller_test.rb
Normal file
8
test/functional/tags_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class TagsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/unapprovals_controller_test.rb
Normal file
8
test/functional/unapprovals_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UnapprovalsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/uploads_controller_test.rb
Normal file
8
test/functional/uploads_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UploadsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/user_feedback_controller_test.rb
Normal file
8
test/functional/user_feedback_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UserFeedbackControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/users_controller_test.rb
Normal file
8
test/functional/users_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UsersControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/wiki_page_versions_controller_test.rb
Normal file
8
test/functional/wiki_page_versions_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class WikiPageVersionsControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
8
test/functional/wiki_pages_controller_test.rb
Normal file
8
test/functional/wiki_pages_controller_test.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class WikiPagesControllerTest < ActionController::TestCase
|
||||
# Replace this with your real tests.
|
||||
test "the truth" do
|
||||
assert true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user