From ac98d7db37054254f645395766e96af143c691e4 Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 10 Mar 2010 18:21:43 -0500 Subject: [PATCH] stubbed in blank controllers/helpers/functional tests --- TODO | 40 +++++++ app/controllers/admin/users_controller.rb | 2 + app/controllers/advertisements_controller.rb | 22 ++++ app/controllers/application_controller.rb | 66 +++++++++++ app/controllers/artist_versions_controller.rb | 7 ++ app/controllers/artists_controller.rb | 25 +++++ app/controllers/bans_controller.rb | 19 ++++ app/controllers/comment_votes_controller.rb | 7 ++ app/controllers/comments_controller.rb | 7 ++ app/controllers/dmails_controller.rb | 13 +++ app/controllers/favorites_controller.rb | 7 ++ app/controllers/forum_posts_controller.rb | 19 ++++ app/controllers/forum_topics_controller.rb | 22 ++++ app/controllers/janitor_trials_controller.rb | 19 ++++ app/controllers/jobs_controller.rb | 16 +++ app/controllers/notes_controller.rb | 16 +++ app/controllers/pool_versions_controller.rb | 4 + app/controllers/pools_controller.rb | 25 +++++ .../post_moderation_details_controller.rb | 13 +++ app/controllers/post_versions_controller.rb | 4 + app/controllers/post_votes_controller.rb | 7 ++ app/controllers/posts_controller.rb | 16 +++ app/controllers/sessions_controller.rb | 10 ++ app/controllers/tag_aliases_controller.rb | 19 ++++ .../tag_implications_controller.rb | 19 ++++ .../tag_subscriptions_controller.rb | 22 ++++ app/controllers/tags_controller.rb | 13 +++ app/controllers/unapprovals_controller.rb | 13 +++ app/controllers/uploads_controller.rb | 10 ++ app/controllers/user_feedback_controller.rb | 19 ++++ app/controllers/users_controller.rb | 22 ++++ .../wiki_page_versions_controller.rb | 4 + app/controllers/wiki_pages_controller.rb | 25 +++++ app/helpers/admin/users_helper.rb | 2 + app/helpers/advertisements_helper.rb | 2 + app/helpers/application_helper.rb | 60 ++++++++++ app/helpers/artist_versions_helper.rb | 2 + app/helpers/artists_helper.rb | 2 + app/helpers/bans_helper.rb | 2 + app/helpers/comment_votes_helper.rb | 2 + app/helpers/comments_helper.rb | 2 + app/helpers/dmails_helper.rb | 2 + app/helpers/favorites_helper.rb | 2 + app/helpers/forum_posts_helper.rb | 2 + app/helpers/forum_topics_helper.rb | 2 + app/helpers/janitor_trials_helper.rb | 2 + app/helpers/jobs_helper.rb | 2 + app/helpers/notes_helper.rb | 2 + app/helpers/pool_versions_helper.rb | 2 + app/helpers/pools_helper.rb | 2 + app/helpers/post_helper.rb | 2 + app/helpers/post_moderation_details_helper.rb | 2 + app/helpers/post_versions_helper.rb | 2 + app/helpers/post_votes_helper.rb | 2 + app/helpers/sessions_helper.rb | 2 + app/helpers/tag_aliases_helper.rb | 2 + app/helpers/tag_implications_helper.rb | 2 + app/helpers/tag_subscriptions_helper.rb | 2 + app/helpers/tags_helper.rb | 2 + app/helpers/unapprovals_helper.rb | 2 + app/helpers/uploads_helper.rb | 2 + app/helpers/user_feedback_helper.rb | 2 + app/helpers/users_helper.rb | 2 + app/helpers/wiki_page_versions_helper.rb | 2 + app/helpers/wiki_pages_helper.rb | 2 + app/models/user.rb | 11 ++ app/presenters/paginator_presenter.rb | 2 + app/views/layouts/default.html.erb | 76 +++++++++++++ config/danbooru_default_config.rb | 17 +++ config/initializers/inflections.rb | 2 +- config/routes.rb | 106 +++++++++--------- .../stylesheets/danbooru/layouts/default.css | 3 + test/factories/user.rb | 1 + .../functional/admin/users_controller_test.rb | 8 ++ .../advertisements_controller_test.rb | 8 ++ .../artist_versions_controller_test.rb | 8 ++ test/functional/artists_controller_test.rb | 8 ++ test/functional/bans_controller_test.rb | 8 ++ .../comment_votes_controller_test.rb | 8 ++ test/functional/comments_controller_test.rb | 8 ++ test/functional/dmails_controller_test.rb | 8 ++ test/functional/favorites_controller_test.rb | 8 ++ .../functional/forum_posts_controller_test.rb | 8 ++ .../forum_topics_controller_test.rb | 8 ++ .../janitor_trials_controller_test.rb | 8 ++ test/functional/jobs_controller_test.rb | 8 ++ test/functional/notes_controller_test.rb | 8 ++ .../pool_versions_controller_test.rb | 8 ++ test/functional/pools_controller_test.rb | 8 ++ test/functional/post_controller_test.rb | 90 +++++++++++++++ .../post_moderation_detail_controller_test.rb | 37 ++++++ ...post_moderation_details_controller_test.rb | 8 ++ .../post_versions_controller_test.rb | 8 ++ test/functional/post_votes_controller_test.rb | 8 ++ test/functional/sessions_controller_test.rb | 8 ++ .../functional/tag_aliases_controller_test.rb | 8 ++ .../tag_implications_controller_test.rb | 8 ++ .../tag_subscriptions_controller_test.rb | 8 ++ test/functional/tags_controller_test.rb | 8 ++ .../functional/unapprovals_controller_test.rb | 8 ++ test/functional/uploads_controller_test.rb | 8 ++ .../user_feedback_controller_test.rb | 8 ++ test/functional/users_controller_test.rb | 8 ++ .../wiki_page_versions_controller_test.rb | 8 ++ test/functional/wiki_pages_controller_test.rb | 8 ++ test/test_helper.rb | 24 +++- test/unit/helpers/admin/users_helper_test.rb | 4 + .../helpers/advertisements_helper_test.rb | 4 + .../helpers/artist_versions_helper_test.rb | 4 + test/unit/helpers/artists_helper_test.rb | 4 + test/unit/helpers/bans_helper_test.rb | 4 + .../unit/helpers/comment_votes_helper_test.rb | 4 + test/unit/helpers/comments_helper_test.rb | 4 + test/unit/helpers/dmails_helper_test.rb | 4 + test/unit/helpers/favorites_helper_test.rb | 4 + test/unit/helpers/forum_posts_helper_test.rb | 4 + test/unit/helpers/forum_topics_helper_test.rb | 4 + .../helpers/janitor_trials_helper_test.rb | 4 + test/unit/helpers/jobs_helper_test.rb | 4 + test/unit/helpers/notes_helper_test.rb | 4 + .../unit/helpers/pool_versions_helper_test.rb | 4 + test/unit/helpers/pools_helper_test.rb | 4 + test/unit/helpers/post_helper_test.rb | 4 + .../post_moderation_details_helper_test.rb | 4 + .../unit/helpers/post_versions_helper_test.rb | 4 + test/unit/helpers/post_votes_helper_test.rb | 4 + test/unit/helpers/sessions_helper_test.rb | 4 + test/unit/helpers/tag_aliases_helper_test.rb | 4 + .../helpers/tag_implications_helper_test.rb | 4 + .../helpers/tag_subscriptions_helper_test.rb | 4 + test/unit/helpers/tags_helper_test.rb | 4 + test/unit/helpers/unapprovals_helper_test.rb | 4 + test/unit/helpers/uploads_helper_test.rb | 4 + .../unit/helpers/user_feedback_helper_test.rb | 4 + test/unit/helpers/users_helper_test.rb | 4 + .../helpers/wiki_page_versions_helper_test.rb | 4 + test/unit/helpers/wiki_pages_helper_test.rb | 4 + 137 files changed, 1349 insertions(+), 58 deletions(-) create mode 100644 TODO create mode 100644 app/controllers/admin/users_controller.rb create mode 100644 app/controllers/advertisements_controller.rb create mode 100644 app/controllers/artist_versions_controller.rb create mode 100644 app/controllers/artists_controller.rb create mode 100644 app/controllers/bans_controller.rb create mode 100644 app/controllers/comment_votes_controller.rb create mode 100644 app/controllers/comments_controller.rb create mode 100644 app/controllers/dmails_controller.rb create mode 100644 app/controllers/favorites_controller.rb create mode 100644 app/controllers/forum_posts_controller.rb create mode 100644 app/controllers/forum_topics_controller.rb create mode 100644 app/controllers/janitor_trials_controller.rb create mode 100644 app/controllers/jobs_controller.rb create mode 100644 app/controllers/notes_controller.rb create mode 100644 app/controllers/pool_versions_controller.rb create mode 100644 app/controllers/pools_controller.rb create mode 100644 app/controllers/post_moderation_details_controller.rb create mode 100644 app/controllers/post_versions_controller.rb create mode 100644 app/controllers/post_votes_controller.rb create mode 100644 app/controllers/posts_controller.rb create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/controllers/tag_aliases_controller.rb create mode 100644 app/controllers/tag_implications_controller.rb create mode 100644 app/controllers/tag_subscriptions_controller.rb create mode 100644 app/controllers/tags_controller.rb create mode 100644 app/controllers/unapprovals_controller.rb create mode 100644 app/controllers/uploads_controller.rb create mode 100644 app/controllers/user_feedback_controller.rb create mode 100644 app/controllers/users_controller.rb create mode 100644 app/controllers/wiki_page_versions_controller.rb create mode 100644 app/controllers/wiki_pages_controller.rb create mode 100644 app/helpers/admin/users_helper.rb create mode 100644 app/helpers/advertisements_helper.rb create mode 100644 app/helpers/artist_versions_helper.rb create mode 100644 app/helpers/artists_helper.rb create mode 100644 app/helpers/bans_helper.rb create mode 100644 app/helpers/comment_votes_helper.rb create mode 100644 app/helpers/comments_helper.rb create mode 100644 app/helpers/dmails_helper.rb create mode 100644 app/helpers/favorites_helper.rb create mode 100644 app/helpers/forum_posts_helper.rb create mode 100644 app/helpers/forum_topics_helper.rb create mode 100644 app/helpers/janitor_trials_helper.rb create mode 100644 app/helpers/jobs_helper.rb create mode 100644 app/helpers/notes_helper.rb create mode 100644 app/helpers/pool_versions_helper.rb create mode 100644 app/helpers/pools_helper.rb create mode 100644 app/helpers/post_helper.rb create mode 100644 app/helpers/post_moderation_details_helper.rb create mode 100644 app/helpers/post_versions_helper.rb create mode 100644 app/helpers/post_votes_helper.rb create mode 100644 app/helpers/sessions_helper.rb create mode 100644 app/helpers/tag_aliases_helper.rb create mode 100644 app/helpers/tag_implications_helper.rb create mode 100644 app/helpers/tag_subscriptions_helper.rb create mode 100644 app/helpers/tags_helper.rb create mode 100644 app/helpers/unapprovals_helper.rb create mode 100644 app/helpers/uploads_helper.rb create mode 100644 app/helpers/user_feedback_helper.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/helpers/wiki_page_versions_helper.rb create mode 100644 app/helpers/wiki_pages_helper.rb create mode 100644 app/presenters/paginator_presenter.rb create mode 100644 app/views/layouts/default.html.erb create mode 100644 public/stylesheets/danbooru/layouts/default.css create mode 100644 test/functional/admin/users_controller_test.rb create mode 100644 test/functional/advertisements_controller_test.rb create mode 100644 test/functional/artist_versions_controller_test.rb create mode 100644 test/functional/artists_controller_test.rb create mode 100644 test/functional/bans_controller_test.rb create mode 100644 test/functional/comment_votes_controller_test.rb create mode 100644 test/functional/comments_controller_test.rb create mode 100644 test/functional/dmails_controller_test.rb create mode 100644 test/functional/favorites_controller_test.rb create mode 100644 test/functional/forum_posts_controller_test.rb create mode 100644 test/functional/forum_topics_controller_test.rb create mode 100644 test/functional/janitor_trials_controller_test.rb create mode 100644 test/functional/jobs_controller_test.rb create mode 100644 test/functional/notes_controller_test.rb create mode 100644 test/functional/pool_versions_controller_test.rb create mode 100644 test/functional/pools_controller_test.rb create mode 100644 test/functional/post_controller_test.rb create mode 100644 test/functional/post_moderation_detail_controller_test.rb create mode 100644 test/functional/post_moderation_details_controller_test.rb create mode 100644 test/functional/post_versions_controller_test.rb create mode 100644 test/functional/post_votes_controller_test.rb create mode 100644 test/functional/sessions_controller_test.rb create mode 100644 test/functional/tag_aliases_controller_test.rb create mode 100644 test/functional/tag_implications_controller_test.rb create mode 100644 test/functional/tag_subscriptions_controller_test.rb create mode 100644 test/functional/tags_controller_test.rb create mode 100644 test/functional/unapprovals_controller_test.rb create mode 100644 test/functional/uploads_controller_test.rb create mode 100644 test/functional/user_feedback_controller_test.rb create mode 100644 test/functional/users_controller_test.rb create mode 100644 test/functional/wiki_page_versions_controller_test.rb create mode 100644 test/functional/wiki_pages_controller_test.rb create mode 100644 test/unit/helpers/admin/users_helper_test.rb create mode 100644 test/unit/helpers/advertisements_helper_test.rb create mode 100644 test/unit/helpers/artist_versions_helper_test.rb create mode 100644 test/unit/helpers/artists_helper_test.rb create mode 100644 test/unit/helpers/bans_helper_test.rb create mode 100644 test/unit/helpers/comment_votes_helper_test.rb create mode 100644 test/unit/helpers/comments_helper_test.rb create mode 100644 test/unit/helpers/dmails_helper_test.rb create mode 100644 test/unit/helpers/favorites_helper_test.rb create mode 100644 test/unit/helpers/forum_posts_helper_test.rb create mode 100644 test/unit/helpers/forum_topics_helper_test.rb create mode 100644 test/unit/helpers/janitor_trials_helper_test.rb create mode 100644 test/unit/helpers/jobs_helper_test.rb create mode 100644 test/unit/helpers/notes_helper_test.rb create mode 100644 test/unit/helpers/pool_versions_helper_test.rb create mode 100644 test/unit/helpers/pools_helper_test.rb create mode 100644 test/unit/helpers/post_helper_test.rb create mode 100644 test/unit/helpers/post_moderation_details_helper_test.rb create mode 100644 test/unit/helpers/post_versions_helper_test.rb create mode 100644 test/unit/helpers/post_votes_helper_test.rb create mode 100644 test/unit/helpers/sessions_helper_test.rb create mode 100644 test/unit/helpers/tag_aliases_helper_test.rb create mode 100644 test/unit/helpers/tag_implications_helper_test.rb create mode 100644 test/unit/helpers/tag_subscriptions_helper_test.rb create mode 100644 test/unit/helpers/tags_helper_test.rb create mode 100644 test/unit/helpers/unapprovals_helper_test.rb create mode 100644 test/unit/helpers/uploads_helper_test.rb create mode 100644 test/unit/helpers/user_feedback_helper_test.rb create mode 100644 test/unit/helpers/users_helper_test.rb create mode 100644 test/unit/helpers/wiki_page_versions_helper_test.rb create mode 100644 test/unit/helpers/wiki_pages_helper_test.rb diff --git a/TODO b/TODO new file mode 100644 index 000000000..5013fe1ed --- /dev/null +++ b/TODO @@ -0,0 +1,40 @@ +CRITICAL + +* Note translation mode. Click-and-drag to create a new note box. +* Note translation locking. When a post is locked, either prevent note edits by other users or notify them somehow. Should be timestamped so if someone fails to unlock a post it won't stay locked forever. +* Move help pages to the wiki. + + +IMPORTANT + +* Require users to enter their password for some sensitive actions. +* Ability to change your account name. +* Ability to close your account. +* Protection against mass assignment. +* Eliminate password cookies. +* Replace parent/child relationships with anonymous pools. Each post would have a related posts field. This would drive the creation of an anonymous pool. +* Use a SSL cert for the login page. +* Ability to copy all notes from one post to another. +* Single post pagination mode. +* Ability to pull related tags from the wiki. + + +NICE TO HAVE + +* Improved pool ordering interface. +* Ability to link users using dtext. +* Ability to highlight pools that have been updated since your last visit. +* Image similarity search integration. +* Ability to search post versions by tags. +* Tag autocompletion. +* Better formatting on comment/forum post preview so that the widths match the actual page. +* Searching for comments by tags. +* Face detection script (http://anime.udp.jp/face-detect) +* Use tf-idf to calculate tag relevance (http://en.wikipedia.org/wiki/Tf%E2%80%93idf) +* Upload progress meter (http://github.com/masterzen/nginx-upload-progress-module) +* Ajax upload form (http://valums.com/ajax-upload) + + +MAYBE + +* Someone here mentioned the idea of tying tags to notes. I think this is the best way of clustering tags together on a post. I probably won't take a crack at this until after the initial deployment but it's something to keep in mind. \ No newline at end of file diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb new file mode 100644 index 000000000..b5bd3acaa --- /dev/null +++ b/app/controllers/admin/users_controller.rb @@ -0,0 +1,2 @@ +class Admin::UsersController < ApplicationController +end diff --git a/app/controllers/advertisements_controller.rb b/app/controllers/advertisements_controller.rb new file mode 100644 index 000000000..fa66d1ff1 --- /dev/null +++ b/app/controllers/advertisements_controller.rb @@ -0,0 +1,22 @@ +class AdvertisementsController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8065d950..932f9eeef 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,69 @@ class ApplicationController < ActionController::Base protect_from_forgery + before_filter :set_current_user + before_filter :initialize_cookies + +protected + def access_denied + previous_url = params[:url] || request.request_uri + + respond_to do |fmt| + fmt.html do + if request.get? && Rails.environment != "test" + redirect_to new_sessions_path(:url => previous_url), :notice => "Access denied" + else + redirect_to new_sessions_path, :notice => "Access denied" + end + end + fmt.xml do + render :xml => {:success => false, :reason => "access denied"}.to_xml(:root => "response"), :status => 403 + end + fmt.json do + render :json => {:success => false, :reason => "access denied"}.to_json, :status => 403 + end + end + end + + def set_current_user + if @current_user == nil && session[:user_id] + @current_user = User.find_by_id(session[:user_id]) + end + + if @current_user == nil && params[:user] + @current_user = User.authenticate(params[:user][:name], params[:user][:password]) + end + + if @current_user == nil && params[:api] + @current_user = User.authenticate(params[:api][:key], params[:api][:hash]) + end + + if @current_user + if @current_user.is_banned? && @current_user.ban && @current_user.ban.expires_at < Time.now + @current_user.update_attribute(:is_banned, false) + Ban.destroy_all("user_id = #{@current_user.id}") + end + + session[:user_id] = @current_user.id + else + @current_user = AnonymousUser.new + end + end + + %w(banned privileged contributor janitor moderator admin).each do |level| + define_method("#{level}_only") do + if @current_user.__send__("is_#{level}?") + true + else + access_denied() + end + end + end + + def initialize_cookies + if @current_user.is_anonymous? + cookies["blacklisted_tags"] = "" + else + cookies["blacklisted_tags"] = @current_user.blacklisted_tags + end + end end diff --git a/app/controllers/artist_versions_controller.rb b/app/controllers/artist_versions_controller.rb new file mode 100644 index 000000000..f0c67eaa3 --- /dev/null +++ b/app/controllers/artist_versions_controller.rb @@ -0,0 +1,7 @@ +class ArtistVersionsController < ApplicationController + def index + end + + def show + end +end diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb new file mode 100644 index 000000000..2b83ec653 --- /dev/null +++ b/app/controllers/artists_controller.rb @@ -0,0 +1,25 @@ +class ArtistsController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end + + def revert + end +end diff --git a/app/controllers/bans_controller.rb b/app/controllers/bans_controller.rb new file mode 100644 index 000000000..4c78af68e --- /dev/null +++ b/app/controllers/bans_controller.rb @@ -0,0 +1,19 @@ +class BansController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end +end diff --git a/app/controllers/comment_votes_controller.rb b/app/controllers/comment_votes_controller.rb new file mode 100644 index 000000000..0863994fd --- /dev/null +++ b/app/controllers/comment_votes_controller.rb @@ -0,0 +1,7 @@ +class CommentVotesController < ApplicationController + def create + end + + def destroy + end +end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb new file mode 100644 index 000000000..0eca12f53 --- /dev/null +++ b/app/controllers/comments_controller.rb @@ -0,0 +1,7 @@ +class CommentsController < ApplicationController + def index + end + + def update + end +end diff --git a/app/controllers/dmails_controller.rb b/app/controllers/dmails_controller.rb new file mode 100644 index 000000000..4bb427577 --- /dev/null +++ b/app/controllers/dmails_controller.rb @@ -0,0 +1,13 @@ +class DmailsController < ApplicationController + def new + end + + def index + end + + def show + end + + def create + end +end diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb new file mode 100644 index 000000000..f36237cf8 --- /dev/null +++ b/app/controllers/favorites_controller.rb @@ -0,0 +1,7 @@ +class FavoritesController < ApplicationController + def create + end + + def destroy + end +end diff --git a/app/controllers/forum_posts_controller.rb b/app/controllers/forum_posts_controller.rb new file mode 100644 index 000000000..8770ed1b9 --- /dev/null +++ b/app/controllers/forum_posts_controller.rb @@ -0,0 +1,19 @@ +class ForumPostsController < ApplicationController + def new + end + + def edit + end + + def show + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/forum_topics_controller.rb b/app/controllers/forum_topics_controller.rb new file mode 100644 index 000000000..39c7ce7cf --- /dev/null +++ b/app/controllers/forum_topics_controller.rb @@ -0,0 +1,22 @@ +class ForumTopicsController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/janitor_trials_controller.rb b/app/controllers/janitor_trials_controller.rb new file mode 100644 index 000000000..64edaa45a --- /dev/null +++ b/app/controllers/janitor_trials_controller.rb @@ -0,0 +1,19 @@ +class JanitorTrialsController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end +end diff --git a/app/controllers/jobs_controller.rb b/app/controllers/jobs_controller.rb new file mode 100644 index 000000000..50e8eef0e --- /dev/null +++ b/app/controllers/jobs_controller.rb @@ -0,0 +1,16 @@ +class JobsController < ApplicationController + def edit + end + + def index + end + + def show + end + + def destroy + end + + def update + end +end diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb new file mode 100644 index 000000000..91f75d3cc --- /dev/null +++ b/app/controllers/notes_controller.rb @@ -0,0 +1,16 @@ +class NotesController < ApplicationController + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/pool_versions_controller.rb b/app/controllers/pool_versions_controller.rb new file mode 100644 index 000000000..935f3eec1 --- /dev/null +++ b/app/controllers/pool_versions_controller.rb @@ -0,0 +1,4 @@ +class PoolVersionsController < ApplicationController + def index + end +end diff --git a/app/controllers/pools_controller.rb b/app/controllers/pools_controller.rb new file mode 100644 index 000000000..ecda00d8f --- /dev/null +++ b/app/controllers/pools_controller.rb @@ -0,0 +1,25 @@ +class PoolsController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end + + def revert + end +end diff --git a/app/controllers/post_moderation_details_controller.rb b/app/controllers/post_moderation_details_controller.rb new file mode 100644 index 000000000..011ae0991 --- /dev/null +++ b/app/controllers/post_moderation_details_controller.rb @@ -0,0 +1,13 @@ +class PostModerationDetailsController < ApplicationController + def index + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/post_versions_controller.rb b/app/controllers/post_versions_controller.rb new file mode 100644 index 000000000..7ceb99fec --- /dev/null +++ b/app/controllers/post_versions_controller.rb @@ -0,0 +1,4 @@ +class PostVersionsController < ApplicationController + def index + end +end diff --git a/app/controllers/post_votes_controller.rb b/app/controllers/post_votes_controller.rb new file mode 100644 index 000000000..d94fa457d --- /dev/null +++ b/app/controllers/post_votes_controller.rb @@ -0,0 +1,7 @@ +class PostVotesController < ApplicationController + def create + end + + def destroy + end +end diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb new file mode 100644 index 000000000..d72579de5 --- /dev/null +++ b/app/controllers/posts_controller.rb @@ -0,0 +1,16 @@ +class PostsController < ApplicationController + before_filter :member_only, :except => [:show, :index] + after_filter :save_recent_tags, :only => [:create, :update] + + def index + end + + def show + end + + def update + end + + def revert + end +end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 000000000..0369c3e75 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,10 @@ +class SessionsController < ApplicationController + def new + end + + def create + end + + def destroy + end +end diff --git a/app/controllers/tag_aliases_controller.rb b/app/controllers/tag_aliases_controller.rb new file mode 100644 index 000000000..c1e209b0a --- /dev/null +++ b/app/controllers/tag_aliases_controller.rb @@ -0,0 +1,19 @@ +class TagAliasesController < ApplicationController + def new + end + + def edit + end + + def index + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/tag_implications_controller.rb b/app/controllers/tag_implications_controller.rb new file mode 100644 index 000000000..5474c91e4 --- /dev/null +++ b/app/controllers/tag_implications_controller.rb @@ -0,0 +1,19 @@ +class TagImplicationsController < ApplicationController + def new + end + + def edit + end + + def index + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/tag_subscriptions_controller.rb b/app/controllers/tag_subscriptions_controller.rb new file mode 100644 index 000000000..469ff02fa --- /dev/null +++ b/app/controllers/tag_subscriptions_controller.rb @@ -0,0 +1,22 @@ +class TagSubscriptionsController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb new file mode 100644 index 000000000..7f2db9cfe --- /dev/null +++ b/app/controllers/tags_controller.rb @@ -0,0 +1,13 @@ +class TagsController < ApplicationController + def edit + end + + def index + end + + def show + end + + def update + end +end diff --git a/app/controllers/unapprovals_controller.rb b/app/controllers/unapprovals_controller.rb new file mode 100644 index 000000000..d03ad15ea --- /dev/null +++ b/app/controllers/unapprovals_controller.rb @@ -0,0 +1,13 @@ +class UnapprovalsController < ApplicationController + def new + end + + def index + end + + def create + end + + def destroy + end +end diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb new file mode 100644 index 000000000..4657e514e --- /dev/null +++ b/app/controllers/uploads_controller.rb @@ -0,0 +1,10 @@ +class UploadsController < ApplicationController + def new + end + + def show + end + + def create + end +end diff --git a/app/controllers/user_feedback_controller.rb b/app/controllers/user_feedback_controller.rb new file mode 100644 index 000000000..3e2232d24 --- /dev/null +++ b/app/controllers/user_feedback_controller.rb @@ -0,0 +1,19 @@ +class UserFeedbackController < ApplicationController + def new + end + + def edit + end + + def index + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 000000000..19f1926ba --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,22 @@ +class UsersController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end +end diff --git a/app/controllers/wiki_page_versions_controller.rb b/app/controllers/wiki_page_versions_controller.rb new file mode 100644 index 000000000..af59db251 --- /dev/null +++ b/app/controllers/wiki_page_versions_controller.rb @@ -0,0 +1,4 @@ +class WikiPageVersionsController < ApplicationController + def index + end +end diff --git a/app/controllers/wiki_pages_controller.rb b/app/controllers/wiki_pages_controller.rb new file mode 100644 index 000000000..250efab15 --- /dev/null +++ b/app/controllers/wiki_pages_controller.rb @@ -0,0 +1,25 @@ +class WikiPagesController < ApplicationController + def new + end + + def edit + end + + def index + end + + def show + end + + def create + end + + def update + end + + def destroy + end + + def revert + end +end diff --git a/app/helpers/admin/users_helper.rb b/app/helpers/admin/users_helper.rb new file mode 100644 index 000000000..5995c2aa8 --- /dev/null +++ b/app/helpers/admin/users_helper.rb @@ -0,0 +1,2 @@ +module Admin::UsersHelper +end diff --git a/app/helpers/advertisements_helper.rb b/app/helpers/advertisements_helper.rb new file mode 100644 index 000000000..a7d3aa99c --- /dev/null +++ b/app/helpers/advertisements_helper.rb @@ -0,0 +1,2 @@ +module AdvertisementsHelper +end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be7945..85b3481cc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,62 @@ module ApplicationHelper + def nav_link_to(text, options, html_options = nil) + if options[:controller] == params[:controller] || (%w(tag_alias tag_implication).include?(params[:controller]) && options[:controller] == "tag") + klass = "current-page" + else + klass = nil + end + + %{
  • } + fast_link_to(text, options, html_options) + "
  • " + end + + def format_text(text, options = {}) + DText.parse(text) + end + + def id_to_color(id) + r = id % 255 + g = (id >> 8) % 255 + b = (id >> 16) % 255 + "rgb(#{r}, #{g}, #{b})" + end + + def tag_header(tags) + unless tags.blank? + '/' + Tag.scan_query(tags).map {|t| link_to(h(t.tr("_", " ")), posts_path(:tags => t)}.join("+") + end + end + + def compact_time(time) + if time > Time.now.beginning_of_day + time.strftime("%H:%M") + elsif time > Time.now.beginning_of_year + time.strftime("%b %e") + else + time.strftime("%b %e, %Y") + end + end + + def print_preview(post, options = {}) + unless Danbooru.config.can_see_post?(post, @current_user) + return "" + end + + options = {:blacklist => true}.merge(options) + + blacklist = options[:blacklist] ? "blacklisted" : "" + width, height = post.preview_dimensions + image_id = options[:image_id] + image_id = %{id="#{h(image_id)}"} if image_id + title = "#{h(post.cached_tags)} rating:#{post.rating} score:#{post.score} uploader:#{h(post.uploader_name)}" + + content_for(:blacklist) {"Post.register(#{post.to_json});\n"} if options[:blacklist] + + %{ + + + #{title} + + + } + end end diff --git a/app/helpers/artist_versions_helper.rb b/app/helpers/artist_versions_helper.rb new file mode 100644 index 000000000..7f21d83ff --- /dev/null +++ b/app/helpers/artist_versions_helper.rb @@ -0,0 +1,2 @@ +module ArtistVersionsHelper +end diff --git a/app/helpers/artists_helper.rb b/app/helpers/artists_helper.rb new file mode 100644 index 000000000..52d21cb9a --- /dev/null +++ b/app/helpers/artists_helper.rb @@ -0,0 +1,2 @@ +module ArtistsHelper +end diff --git a/app/helpers/bans_helper.rb b/app/helpers/bans_helper.rb new file mode 100644 index 000000000..f867b03af --- /dev/null +++ b/app/helpers/bans_helper.rb @@ -0,0 +1,2 @@ +module BansHelper +end diff --git a/app/helpers/comment_votes_helper.rb b/app/helpers/comment_votes_helper.rb new file mode 100644 index 000000000..3a6d375a0 --- /dev/null +++ b/app/helpers/comment_votes_helper.rb @@ -0,0 +1,2 @@ +module CommentVotesHelper +end diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb new file mode 100644 index 000000000..0ec9ca5f2 --- /dev/null +++ b/app/helpers/comments_helper.rb @@ -0,0 +1,2 @@ +module CommentsHelper +end diff --git a/app/helpers/dmails_helper.rb b/app/helpers/dmails_helper.rb new file mode 100644 index 000000000..3583e9cf4 --- /dev/null +++ b/app/helpers/dmails_helper.rb @@ -0,0 +1,2 @@ +module DmailsHelper +end diff --git a/app/helpers/favorites_helper.rb b/app/helpers/favorites_helper.rb new file mode 100644 index 000000000..4e9a95009 --- /dev/null +++ b/app/helpers/favorites_helper.rb @@ -0,0 +1,2 @@ +module FavoritesHelper +end diff --git a/app/helpers/forum_posts_helper.rb b/app/helpers/forum_posts_helper.rb new file mode 100644 index 000000000..1352dcea1 --- /dev/null +++ b/app/helpers/forum_posts_helper.rb @@ -0,0 +1,2 @@ +module ForumPostsHelper +end diff --git a/app/helpers/forum_topics_helper.rb b/app/helpers/forum_topics_helper.rb new file mode 100644 index 000000000..39d0dbab9 --- /dev/null +++ b/app/helpers/forum_topics_helper.rb @@ -0,0 +1,2 @@ +module ForumTopicsHelper +end diff --git a/app/helpers/janitor_trials_helper.rb b/app/helpers/janitor_trials_helper.rb new file mode 100644 index 000000000..dc24fa5fb --- /dev/null +++ b/app/helpers/janitor_trials_helper.rb @@ -0,0 +1,2 @@ +module JanitorTrialsHelper +end diff --git a/app/helpers/jobs_helper.rb b/app/helpers/jobs_helper.rb new file mode 100644 index 000000000..44c7bf621 --- /dev/null +++ b/app/helpers/jobs_helper.rb @@ -0,0 +1,2 @@ +module JobsHelper +end diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb new file mode 100644 index 000000000..8078f7303 --- /dev/null +++ b/app/helpers/notes_helper.rb @@ -0,0 +1,2 @@ +module NotesHelper +end diff --git a/app/helpers/pool_versions_helper.rb b/app/helpers/pool_versions_helper.rb new file mode 100644 index 000000000..e6c725d36 --- /dev/null +++ b/app/helpers/pool_versions_helper.rb @@ -0,0 +1,2 @@ +module PoolVersionsHelper +end diff --git a/app/helpers/pools_helper.rb b/app/helpers/pools_helper.rb new file mode 100644 index 000000000..a836b764a --- /dev/null +++ b/app/helpers/pools_helper.rb @@ -0,0 +1,2 @@ +module PoolsHelper +end diff --git a/app/helpers/post_helper.rb b/app/helpers/post_helper.rb new file mode 100644 index 000000000..01357d239 --- /dev/null +++ b/app/helpers/post_helper.rb @@ -0,0 +1,2 @@ +module PostHelper +end diff --git a/app/helpers/post_moderation_details_helper.rb b/app/helpers/post_moderation_details_helper.rb new file mode 100644 index 000000000..a3a7e13ed --- /dev/null +++ b/app/helpers/post_moderation_details_helper.rb @@ -0,0 +1,2 @@ +module PostModerationDetailsHelper +end diff --git a/app/helpers/post_versions_helper.rb b/app/helpers/post_versions_helper.rb new file mode 100644 index 000000000..ad8771876 --- /dev/null +++ b/app/helpers/post_versions_helper.rb @@ -0,0 +1,2 @@ +module PostVersionsHelper +end diff --git a/app/helpers/post_votes_helper.rb b/app/helpers/post_votes_helper.rb new file mode 100644 index 000000000..096e58950 --- /dev/null +++ b/app/helpers/post_votes_helper.rb @@ -0,0 +1,2 @@ +module PostVotesHelper +end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb new file mode 100644 index 000000000..309f8b2eb --- /dev/null +++ b/app/helpers/sessions_helper.rb @@ -0,0 +1,2 @@ +module SessionsHelper +end diff --git a/app/helpers/tag_aliases_helper.rb b/app/helpers/tag_aliases_helper.rb new file mode 100644 index 000000000..7c9f51cf7 --- /dev/null +++ b/app/helpers/tag_aliases_helper.rb @@ -0,0 +1,2 @@ +module TagAliasesHelper +end diff --git a/app/helpers/tag_implications_helper.rb b/app/helpers/tag_implications_helper.rb new file mode 100644 index 000000000..58b4f55f9 --- /dev/null +++ b/app/helpers/tag_implications_helper.rb @@ -0,0 +1,2 @@ +module TagImplicationsHelper +end diff --git a/app/helpers/tag_subscriptions_helper.rb b/app/helpers/tag_subscriptions_helper.rb new file mode 100644 index 000000000..b54ee4908 --- /dev/null +++ b/app/helpers/tag_subscriptions_helper.rb @@ -0,0 +1,2 @@ +module TagSubscriptionsHelper +end diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb new file mode 100644 index 000000000..23450bc5c --- /dev/null +++ b/app/helpers/tags_helper.rb @@ -0,0 +1,2 @@ +module TagsHelper +end diff --git a/app/helpers/unapprovals_helper.rb b/app/helpers/unapprovals_helper.rb new file mode 100644 index 000000000..34aa85164 --- /dev/null +++ b/app/helpers/unapprovals_helper.rb @@ -0,0 +1,2 @@ +module UnapprovalsHelper +end diff --git a/app/helpers/uploads_helper.rb b/app/helpers/uploads_helper.rb new file mode 100644 index 000000000..f4f8250f5 --- /dev/null +++ b/app/helpers/uploads_helper.rb @@ -0,0 +1,2 @@ +module UploadsHelper +end diff --git a/app/helpers/user_feedback_helper.rb b/app/helpers/user_feedback_helper.rb new file mode 100644 index 000000000..adea341b4 --- /dev/null +++ b/app/helpers/user_feedback_helper.rb @@ -0,0 +1,2 @@ +module UserFeedbackHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 000000000..2310a240d --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/helpers/wiki_page_versions_helper.rb b/app/helpers/wiki_page_versions_helper.rb new file mode 100644 index 000000000..eacae640e --- /dev/null +++ b/app/helpers/wiki_page_versions_helper.rb @@ -0,0 +1,2 @@ +module WikiPageVersionsHelper +end diff --git a/app/helpers/wiki_pages_helper.rb b/app/helpers/wiki_pages_helper.rb new file mode 100644 index 000000000..283018a93 --- /dev/null +++ b/app/helpers/wiki_pages_helper.rb @@ -0,0 +1,2 @@ +module WikiPagesHelper +end diff --git a/app/models/user.rb b/app/models/user.rb index eec53a595..656d05e76 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -117,6 +117,10 @@ class User < ActiveRecord::Base self.is_privileged = true end end + + def is_anonymous? + false + end end module EmailVerificationMethods @@ -137,12 +141,19 @@ class User < ActiveRecord::Base end end + module BlacklistMethods + def blacklisted_tag_array + Tag.scan_query(blacklisted_tags) + end + end + include NameMethods include PasswordMethods extend AuthenticationMethods include FavoriteMethods include LevelMethods include EmailVerificationMethods + include BlacklistMethods def can_update?(object, foreign_key = :user_id) is_moderator? || is_admin? || object.__send__(foreign_key) == id diff --git a/app/presenters/paginator_presenter.rb b/app/presenters/paginator_presenter.rb new file mode 100644 index 000000000..aabd68dc6 --- /dev/null +++ b/app/presenters/paginator_presenter.rb @@ -0,0 +1,2 @@ +class PaginatorPresenter +end diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb new file mode 100644 index 000000000..07126dc3f --- /dev/null +++ b/app/views/layouts/default.html.erb @@ -0,0 +1,76 @@ + + + + <%= yield :page_title %> + + + <%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %> + <%= stylesheet_link_tag "default" %> + <%= javascript_include_tag "application" %> + <%= Danbooru.config.custom_html_header_content %> + <%= yield :html_header_content %> + + + + + <% if flash[:notice] %> +
    <%= h flash[:notice] %>
    + <% else %> + + <% end %> + + <% if @current_user.has_mail? %> +
    + <%= link_to "You have mail", dmails_path %> +
    + <% end %> + + <% if !@current_user.is_privileged? %> + + <% 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