stubbed in blank controllers/helpers/functional tests
This commit is contained in:
2
app/controllers/admin/users_controller.rb
Normal file
2
app/controllers/admin/users_controller.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Admin::UsersController < ApplicationController
|
||||
end
|
||||
22
app/controllers/advertisements_controller.rb
Normal file
22
app/controllers/advertisements_controller.rb
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
7
app/controllers/artist_versions_controller.rb
Normal file
7
app/controllers/artist_versions_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class ArtistVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
end
|
||||
25
app/controllers/artists_controller.rb
Normal file
25
app/controllers/artists_controller.rb
Normal file
@@ -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
|
||||
19
app/controllers/bans_controller.rb
Normal file
19
app/controllers/bans_controller.rb
Normal file
@@ -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
|
||||
7
app/controllers/comment_votes_controller.rb
Normal file
7
app/controllers/comment_votes_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class CommentVotesController < ApplicationController
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
7
app/controllers/comments_controller.rb
Normal file
7
app/controllers/comments_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class CommentsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
13
app/controllers/dmails_controller.rb
Normal file
13
app/controllers/dmails_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class DmailsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
end
|
||||
7
app/controllers/favorites_controller.rb
Normal file
7
app/controllers/favorites_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class FavoritesController < ApplicationController
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
19
app/controllers/forum_posts_controller.rb
Normal file
19
app/controllers/forum_posts_controller.rb
Normal file
@@ -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
|
||||
22
app/controllers/forum_topics_controller.rb
Normal file
22
app/controllers/forum_topics_controller.rb
Normal file
@@ -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
|
||||
19
app/controllers/janitor_trials_controller.rb
Normal file
19
app/controllers/janitor_trials_controller.rb
Normal file
@@ -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
|
||||
16
app/controllers/jobs_controller.rb
Normal file
16
app/controllers/jobs_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class JobsController < ApplicationController
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
16
app/controllers/notes_controller.rb
Normal file
16
app/controllers/notes_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class NotesController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
4
app/controllers/pool_versions_controller.rb
Normal file
4
app/controllers/pool_versions_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class PoolVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
end
|
||||
25
app/controllers/pools_controller.rb
Normal file
25
app/controllers/pools_controller.rb
Normal file
@@ -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
|
||||
13
app/controllers/post_moderation_details_controller.rb
Normal file
13
app/controllers/post_moderation_details_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class PostModerationDetailsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
4
app/controllers/post_versions_controller.rb
Normal file
4
app/controllers/post_versions_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class PostVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
end
|
||||
7
app/controllers/post_votes_controller.rb
Normal file
7
app/controllers/post_votes_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class PostVotesController < ApplicationController
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
16
app/controllers/posts_controller.rb
Normal file
16
app/controllers/posts_controller.rb
Normal file
@@ -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
|
||||
10
app/controllers/sessions_controller.rb
Normal file
10
app/controllers/sessions_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class SessionsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
19
app/controllers/tag_aliases_controller.rb
Normal file
19
app/controllers/tag_aliases_controller.rb
Normal file
@@ -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
|
||||
19
app/controllers/tag_implications_controller.rb
Normal file
19
app/controllers/tag_implications_controller.rb
Normal file
@@ -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
|
||||
22
app/controllers/tag_subscriptions_controller.rb
Normal file
22
app/controllers/tag_subscriptions_controller.rb
Normal file
@@ -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
|
||||
13
app/controllers/tags_controller.rb
Normal file
13
app/controllers/tags_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class TagsController < ApplicationController
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
13
app/controllers/unapprovals_controller.rb
Normal file
13
app/controllers/unapprovals_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class UnapprovalsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
10
app/controllers/uploads_controller.rb
Normal file
10
app/controllers/uploads_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class UploadsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
end
|
||||
19
app/controllers/user_feedback_controller.rb
Normal file
19
app/controllers/user_feedback_controller.rb
Normal file
@@ -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
|
||||
22
app/controllers/users_controller.rb
Normal file
22
app/controllers/users_controller.rb
Normal file
@@ -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
|
||||
4
app/controllers/wiki_page_versions_controller.rb
Normal file
4
app/controllers/wiki_page_versions_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class WikiPageVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
end
|
||||
25
app/controllers/wiki_pages_controller.rb
Normal file
25
app/controllers/wiki_pages_controller.rb
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user