+ <% else %>
+
+ <% end %>
+
+ <% if @current_user.has_mail? %>
+
+ <%= link_to "You have mail", dmails_path %>
+
+ <% end %>
+
+ <% if !@current_user.is_privileged? %>
+
+ <%= link_to "Upgrade your account for only $20", users_help_path %>
+ <%= link_to_function "No thanks", "$('upgrade-account').hide(); Cookie.put('hide-upgrade-account', '1', 7)", :id => "hide-upgrade-account-link" %>
+
+ <% end %>
+
+ <% if @current_user.is_banned? %>
+
+ You have been banned.
+ <% if @current_user.ban %>
+ Reason: <%= h @current_user.ban.reason %>.
+ Expires: <%= @current_user.ban.expires_at.strftime('%Y-%m-%d') %>
+ <% end %>
+
+ <% end %>
+
+
+ <%= yield :layout %>
+
+
+
+
+ <%= yield :page_footer_content %>
+
+
diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb
index 62e032a65..1ec65a3a7 100644
--- a/config/danbooru_default_config.rb
+++ b/config/danbooru_default_config.rb
@@ -164,5 +164,22 @@ module Danbooru
4 => "Character"
}
end
+
+ # Any custom code you want to insert into the default layout without
+ # having to modify the templates.
+ def custom_html_header_content
+ <<-EOS
+
+
+ EOS
+ end
end
end
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index 8422db461..a562f1e70 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -1,3 +1,3 @@
ActiveSupport::Inflector.inflections do |inflect|
- inflect.uncountable %w( feedback )
+ inflect.uncountable %w( user_feedback )
end
diff --git a/config/routes.rb b/config/routes.rb
index de5a72e74..8f5210fd8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,58 +1,56 @@
Danbooru::Application.routes.draw do |map|
- # The priority is based upon order of creation:
- # first created -> highest priority.
+ namespace :admin do
+ resources :users
+ end
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
+ resources :advertisements
+ resources :artists do
+ member do
+ put :revert
+ end
+ end
+ resources :artist_versions
+ resources :bans
+ resources :comments
+ resources :comment_votes
+ resources :dmails
+ resources :favorites
+ resources :forum_posts
+ resources :forum_topics
+ resources :janitor_trials
+ resources :jobs
+ resources :notes
+ resources :pools do
+ member do
+ put :revert
+ end
+ end
+ resources :pool_versions
+ resources :posts do
+ member do
+ put :revert
+ end
+ end
+ resources :post_moderation_details
+ resources :post_versions
+ resources :post_votes
+ resources :reports
+ resources :sessions
+ resources :tags
+ resources :tag_aliases
+ resources :tag_implications
+ resources :tag_subscriptions
+ resources :unapprovals
+ resources :users
+ resources :user_feedback
+ resources :wiki_pages do
+ member do
+ put :revert
+ end
+ end
+ resources :wiki_page_versions
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get :short
- # post :toggle
- # end
- #
- # collection do
- # get :sold
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get :recent, :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => "welcome#index"
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id(.:format)))'
+ match "/site_map" => "static#site_map"
+
+ root :to => "post#index"
end
diff --git a/public/stylesheets/danbooru/layouts/default.css b/public/stylesheets/danbooru/layouts/default.css
new file mode 100644
index 000000000..367576362
--- /dev/null
+++ b/public/stylesheets/danbooru/layouts/default.css
@@ -0,0 +1,3 @@
+.blacklisted {
+ display: none !important;
+}
diff --git a/test/factories/user.rb b/test/factories/user.rb
index 6459bb8b0..3ac8203bd 100644
--- a/test/factories/user.rb
+++ b/test/factories/user.rb
@@ -7,6 +7,7 @@ end
Factory.define(:banned_user, :parent => :user) do |f|
f.is_banned true
+ f.ban {|x| x.association(:ban)}
end
Factory.define(:privileged_user, :parent => :user) do |f|
diff --git a/test/functional/admin/users_controller_test.rb b/test/functional/admin/users_controller_test.rb
new file mode 100644
index 000000000..7ddb2a091
--- /dev/null
+++ b/test/functional/admin/users_controller_test.rb
@@ -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
diff --git a/test/functional/advertisements_controller_test.rb b/test/functional/advertisements_controller_test.rb
new file mode 100644
index 000000000..a934755ec
--- /dev/null
+++ b/test/functional/advertisements_controller_test.rb
@@ -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
diff --git a/test/functional/artist_versions_controller_test.rb b/test/functional/artist_versions_controller_test.rb
new file mode 100644
index 000000000..3e0822fe5
--- /dev/null
+++ b/test/functional/artist_versions_controller_test.rb
@@ -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
diff --git a/test/functional/artists_controller_test.rb b/test/functional/artists_controller_test.rb
new file mode 100644
index 000000000..9a8ec84ac
--- /dev/null
+++ b/test/functional/artists_controller_test.rb
@@ -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
diff --git a/test/functional/bans_controller_test.rb b/test/functional/bans_controller_test.rb
new file mode 100644
index 000000000..31c8c3c93
--- /dev/null
+++ b/test/functional/bans_controller_test.rb
@@ -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
diff --git a/test/functional/comment_votes_controller_test.rb b/test/functional/comment_votes_controller_test.rb
new file mode 100644
index 000000000..d9feaa808
--- /dev/null
+++ b/test/functional/comment_votes_controller_test.rb
@@ -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
diff --git a/test/functional/comments_controller_test.rb b/test/functional/comments_controller_test.rb
new file mode 100644
index 000000000..8a86af59b
--- /dev/null
+++ b/test/functional/comments_controller_test.rb
@@ -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
diff --git a/test/functional/dmails_controller_test.rb b/test/functional/dmails_controller_test.rb
new file mode 100644
index 000000000..426027563
--- /dev/null
+++ b/test/functional/dmails_controller_test.rb
@@ -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
diff --git a/test/functional/favorites_controller_test.rb b/test/functional/favorites_controller_test.rb
new file mode 100644
index 000000000..8c04ef9d6
--- /dev/null
+++ b/test/functional/favorites_controller_test.rb
@@ -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
diff --git a/test/functional/forum_posts_controller_test.rb b/test/functional/forum_posts_controller_test.rb
new file mode 100644
index 000000000..b94241f12
--- /dev/null
+++ b/test/functional/forum_posts_controller_test.rb
@@ -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
diff --git a/test/functional/forum_topics_controller_test.rb b/test/functional/forum_topics_controller_test.rb
new file mode 100644
index 000000000..289550cd9
--- /dev/null
+++ b/test/functional/forum_topics_controller_test.rb
@@ -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
diff --git a/test/functional/janitor_trials_controller_test.rb b/test/functional/janitor_trials_controller_test.rb
new file mode 100644
index 000000000..a316910c9
--- /dev/null
+++ b/test/functional/janitor_trials_controller_test.rb
@@ -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
diff --git a/test/functional/jobs_controller_test.rb b/test/functional/jobs_controller_test.rb
new file mode 100644
index 000000000..52f3e3f71
--- /dev/null
+++ b/test/functional/jobs_controller_test.rb
@@ -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
diff --git a/test/functional/notes_controller_test.rb b/test/functional/notes_controller_test.rb
new file mode 100644
index 000000000..6486d610b
--- /dev/null
+++ b/test/functional/notes_controller_test.rb
@@ -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
diff --git a/test/functional/pool_versions_controller_test.rb b/test/functional/pool_versions_controller_test.rb
new file mode 100644
index 000000000..a4c610fe2
--- /dev/null
+++ b/test/functional/pool_versions_controller_test.rb
@@ -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
diff --git a/test/functional/pools_controller_test.rb b/test/functional/pools_controller_test.rb
new file mode 100644
index 000000000..f1f0e2a0d
--- /dev/null
+++ b/test/functional/pools_controller_test.rb
@@ -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
diff --git a/test/functional/post_controller_test.rb b/test/functional/post_controller_test.rb
new file mode 100644
index 000000000..c9c79625e
--- /dev/null
+++ b/test/functional/post_controller_test.rb
@@ -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
diff --git a/test/functional/post_moderation_detail_controller_test.rb b/test/functional/post_moderation_detail_controller_test.rb
new file mode 100644
index 000000000..ee4d7e9e9
--- /dev/null
+++ b/test/functional/post_moderation_detail_controller_test.rb
@@ -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
diff --git a/test/functional/post_moderation_details_controller_test.rb b/test/functional/post_moderation_details_controller_test.rb
new file mode 100644
index 000000000..8c41a8c85
--- /dev/null
+++ b/test/functional/post_moderation_details_controller_test.rb
@@ -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
diff --git a/test/functional/post_versions_controller_test.rb b/test/functional/post_versions_controller_test.rb
new file mode 100644
index 000000000..3c9bd9f6d
--- /dev/null
+++ b/test/functional/post_versions_controller_test.rb
@@ -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
diff --git a/test/functional/post_votes_controller_test.rb b/test/functional/post_votes_controller_test.rb
new file mode 100644
index 000000000..1bee1e608
--- /dev/null
+++ b/test/functional/post_votes_controller_test.rb
@@ -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
diff --git a/test/functional/sessions_controller_test.rb b/test/functional/sessions_controller_test.rb
new file mode 100644
index 000000000..56a35d16e
--- /dev/null
+++ b/test/functional/sessions_controller_test.rb
@@ -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
diff --git a/test/functional/tag_aliases_controller_test.rb b/test/functional/tag_aliases_controller_test.rb
new file mode 100644
index 000000000..50bc5f7f2
--- /dev/null
+++ b/test/functional/tag_aliases_controller_test.rb
@@ -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
diff --git a/test/functional/tag_implications_controller_test.rb b/test/functional/tag_implications_controller_test.rb
new file mode 100644
index 000000000..020e214a1
--- /dev/null
+++ b/test/functional/tag_implications_controller_test.rb
@@ -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
diff --git a/test/functional/tag_subscriptions_controller_test.rb b/test/functional/tag_subscriptions_controller_test.rb
new file mode 100644
index 000000000..a96b4f684
--- /dev/null
+++ b/test/functional/tag_subscriptions_controller_test.rb
@@ -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
diff --git a/test/functional/tags_controller_test.rb b/test/functional/tags_controller_test.rb
new file mode 100644
index 000000000..dcf6b7e57
--- /dev/null
+++ b/test/functional/tags_controller_test.rb
@@ -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
diff --git a/test/functional/unapprovals_controller_test.rb b/test/functional/unapprovals_controller_test.rb
new file mode 100644
index 000000000..5dd2f8b42
--- /dev/null
+++ b/test/functional/unapprovals_controller_test.rb
@@ -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
diff --git a/test/functional/uploads_controller_test.rb b/test/functional/uploads_controller_test.rb
new file mode 100644
index 000000000..0e11761e1
--- /dev/null
+++ b/test/functional/uploads_controller_test.rb
@@ -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
diff --git a/test/functional/user_feedback_controller_test.rb b/test/functional/user_feedback_controller_test.rb
new file mode 100644
index 000000000..a1af27d5e
--- /dev/null
+++ b/test/functional/user_feedback_controller_test.rb
@@ -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
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
new file mode 100644
index 000000000..c3db1230a
--- /dev/null
+++ b/test/functional/users_controller_test.rb
@@ -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
diff --git a/test/functional/wiki_page_versions_controller_test.rb b/test/functional/wiki_page_versions_controller_test.rb
new file mode 100644
index 000000000..0ee4786b6
--- /dev/null
+++ b/test/functional/wiki_page_versions_controller_test.rb
@@ -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
diff --git a/test/functional/wiki_pages_controller_test.rb b/test/functional/wiki_pages_controller_test.rb
new file mode 100644
index 000000000..24e46c11c
--- /dev/null
+++ b/test/functional/wiki_pages_controller_test.rb
@@ -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
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 541f24366..4cdab0699 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -8,9 +8,8 @@ require 'rails/test_help'
Dir[File.expand_path(File.dirname(__FILE__) + "/factories/*.rb")].each {|file| require file}
-class ActiveSupport::TestCase
-protected
- def upload_file(path, content_type, filename)
+module UploadMethods
+ def UploadTestMethods(path, content_type, filename)
tempfile = Tempfile.new(filename)
FileUtils.copy_file(path, tempfile.path)
(class << tempfile; self; end).class_eval do
@@ -26,3 +25,22 @@ protected
upload_file(path, "image/jpeg", File.basename(path))
end
end
+
+class ActiveSupport::TestCase
+ include UploadTestMethods
+end
+
+class ActionController::TestCase
+ include UploadTestMethods
+
+ def assert_authentication_passes(action, http_method, role, params, session)
+ __send__(http_method, action, params, session.merge(:user_id => @users[role].id))
+ assert_response :success
+ end
+
+ def assert_authentication_fails(action, http_method, role)
+ __send__(http_method, action, params, session.merge(:user_id => @users[role].id))
+ assert_redirected_to(new_sessions_path)
+ end
+end
+
diff --git a/test/unit/helpers/admin/users_helper_test.rb b/test/unit/helpers/admin/users_helper_test.rb
new file mode 100644
index 000000000..1b59e3d97
--- /dev/null
+++ b/test/unit/helpers/admin/users_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class Admin::UsersHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/advertisements_helper_test.rb b/test/unit/helpers/advertisements_helper_test.rb
new file mode 100644
index 000000000..275aa95ab
--- /dev/null
+++ b/test/unit/helpers/advertisements_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class AdvertisementsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/artist_versions_helper_test.rb b/test/unit/helpers/artist_versions_helper_test.rb
new file mode 100644
index 000000000..5c945706c
--- /dev/null
+++ b/test/unit/helpers/artist_versions_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ArtistVersionsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/artists_helper_test.rb b/test/unit/helpers/artists_helper_test.rb
new file mode 100644
index 000000000..091990447
--- /dev/null
+++ b/test/unit/helpers/artists_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ArtistsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/bans_helper_test.rb b/test/unit/helpers/bans_helper_test.rb
new file mode 100644
index 000000000..eaa6fcad8
--- /dev/null
+++ b/test/unit/helpers/bans_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class BansHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/comment_votes_helper_test.rb b/test/unit/helpers/comment_votes_helper_test.rb
new file mode 100644
index 000000000..d64ce1917
--- /dev/null
+++ b/test/unit/helpers/comment_votes_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class CommentVotesHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/comments_helper_test.rb b/test/unit/helpers/comments_helper_test.rb
new file mode 100644
index 000000000..2518c16bd
--- /dev/null
+++ b/test/unit/helpers/comments_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class CommentsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/dmails_helper_test.rb b/test/unit/helpers/dmails_helper_test.rb
new file mode 100644
index 000000000..a0f8cb246
--- /dev/null
+++ b/test/unit/helpers/dmails_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class DmailsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/favorites_helper_test.rb b/test/unit/helpers/favorites_helper_test.rb
new file mode 100644
index 000000000..fabd87cb5
--- /dev/null
+++ b/test/unit/helpers/favorites_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class FavoritesHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/forum_posts_helper_test.rb b/test/unit/helpers/forum_posts_helper_test.rb
new file mode 100644
index 000000000..79a6a205d
--- /dev/null
+++ b/test/unit/helpers/forum_posts_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ForumPostsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/forum_topics_helper_test.rb b/test/unit/helpers/forum_topics_helper_test.rb
new file mode 100644
index 000000000..44dddfa85
--- /dev/null
+++ b/test/unit/helpers/forum_topics_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ForumTopicsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/janitor_trials_helper_test.rb b/test/unit/helpers/janitor_trials_helper_test.rb
new file mode 100644
index 000000000..89ea318e6
--- /dev/null
+++ b/test/unit/helpers/janitor_trials_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class JanitorTrialsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/jobs_helper_test.rb b/test/unit/helpers/jobs_helper_test.rb
new file mode 100644
index 000000000..7c4a3fdda
--- /dev/null
+++ b/test/unit/helpers/jobs_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class JobsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/notes_helper_test.rb b/test/unit/helpers/notes_helper_test.rb
new file mode 100644
index 000000000..4984103c7
--- /dev/null
+++ b/test/unit/helpers/notes_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class NotesHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/pool_versions_helper_test.rb b/test/unit/helpers/pool_versions_helper_test.rb
new file mode 100644
index 000000000..9998c4d34
--- /dev/null
+++ b/test/unit/helpers/pool_versions_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PoolVersionsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/pools_helper_test.rb b/test/unit/helpers/pools_helper_test.rb
new file mode 100644
index 000000000..326ce3101
--- /dev/null
+++ b/test/unit/helpers/pools_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PoolsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/post_helper_test.rb b/test/unit/helpers/post_helper_test.rb
new file mode 100644
index 000000000..0dcd1a16d
--- /dev/null
+++ b/test/unit/helpers/post_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PostHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/post_moderation_details_helper_test.rb b/test/unit/helpers/post_moderation_details_helper_test.rb
new file mode 100644
index 000000000..c16d66e50
--- /dev/null
+++ b/test/unit/helpers/post_moderation_details_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PostModerationDetailsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/post_versions_helper_test.rb b/test/unit/helpers/post_versions_helper_test.rb
new file mode 100644
index 000000000..c64f662fe
--- /dev/null
+++ b/test/unit/helpers/post_versions_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PostVersionsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/post_votes_helper_test.rb b/test/unit/helpers/post_votes_helper_test.rb
new file mode 100644
index 000000000..56a91f1ba
--- /dev/null
+++ b/test/unit/helpers/post_votes_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PostVotesHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/sessions_helper_test.rb b/test/unit/helpers/sessions_helper_test.rb
new file mode 100644
index 000000000..7d44e0965
--- /dev/null
+++ b/test/unit/helpers/sessions_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class SessionsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/tag_aliases_helper_test.rb b/test/unit/helpers/tag_aliases_helper_test.rb
new file mode 100644
index 000000000..14032c642
--- /dev/null
+++ b/test/unit/helpers/tag_aliases_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class TagAliasesHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/tag_implications_helper_test.rb b/test/unit/helpers/tag_implications_helper_test.rb
new file mode 100644
index 000000000..e7f53afeb
--- /dev/null
+++ b/test/unit/helpers/tag_implications_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class TagImplicationsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/tag_subscriptions_helper_test.rb b/test/unit/helpers/tag_subscriptions_helper_test.rb
new file mode 100644
index 000000000..40a713ae7
--- /dev/null
+++ b/test/unit/helpers/tag_subscriptions_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class TagSubscriptionsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/tags_helper_test.rb b/test/unit/helpers/tags_helper_test.rb
new file mode 100644
index 000000000..4b1935f8f
--- /dev/null
+++ b/test/unit/helpers/tags_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class TagsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/unapprovals_helper_test.rb b/test/unit/helpers/unapprovals_helper_test.rb
new file mode 100644
index 000000000..45980441f
--- /dev/null
+++ b/test/unit/helpers/unapprovals_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UnapprovalsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/uploads_helper_test.rb b/test/unit/helpers/uploads_helper_test.rb
new file mode 100644
index 000000000..37ed90b83
--- /dev/null
+++ b/test/unit/helpers/uploads_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UploadsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/user_feedback_helper_test.rb b/test/unit/helpers/user_feedback_helper_test.rb
new file mode 100644
index 000000000..f921ddbee
--- /dev/null
+++ b/test/unit/helpers/user_feedback_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UserFeedbackHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/users_helper_test.rb b/test/unit/helpers/users_helper_test.rb
new file mode 100644
index 000000000..96af37a82
--- /dev/null
+++ b/test/unit/helpers/users_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class UsersHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/wiki_page_versions_helper_test.rb b/test/unit/helpers/wiki_page_versions_helper_test.rb
new file mode 100644
index 000000000..9414ffc57
--- /dev/null
+++ b/test/unit/helpers/wiki_page_versions_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class WikiPageVersionsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/wiki_pages_helper_test.rb b/test/unit/helpers/wiki_pages_helper_test.rb
new file mode 100644
index 000000000..74e23ae17
--- /dev/null
+++ b/test/unit/helpers/wiki_pages_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class WikiPagesHelperTest < ActionView::TestCase
+end