stubbed in blank controllers/helpers/functional tests

This commit is contained in:
albert
2010-03-10 18:21:43 -05:00
parent 836b59b1cd
commit ac98d7db37
137 changed files with 1349 additions and 58 deletions

View File

@@ -0,0 +1,2 @@
class Admin::UsersController < ApplicationController
end

View 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

View File

@@ -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

View File

@@ -0,0 +1,7 @@
class ArtistVersionsController < ApplicationController
def index
end
def show
end
end

View 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

View 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

View File

@@ -0,0 +1,7 @@
class CommentVotesController < ApplicationController
def create
end
def destroy
end
end

View File

@@ -0,0 +1,7 @@
class CommentsController < ApplicationController
def index
end
def update
end
end

View File

@@ -0,0 +1,13 @@
class DmailsController < ApplicationController
def new
end
def index
end
def show
end
def create
end
end

View File

@@ -0,0 +1,7 @@
class FavoritesController < ApplicationController
def create
end
def destroy
end
end

View 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

View 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

View 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

View File

@@ -0,0 +1,16 @@
class JobsController < ApplicationController
def edit
end
def index
end
def show
end
def destroy
end
def update
end
end

View File

@@ -0,0 +1,16 @@
class NotesController < ApplicationController
def index
end
def show
end
def create
end
def update
end
def destroy
end
end

View File

@@ -0,0 +1,4 @@
class PoolVersionsController < ApplicationController
def index
end
end

View 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

View File

@@ -0,0 +1,13 @@
class PostModerationDetailsController < ApplicationController
def index
end
def create
end
def update
end
def destroy
end
end

View File

@@ -0,0 +1,4 @@
class PostVersionsController < ApplicationController
def index
end
end

View File

@@ -0,0 +1,7 @@
class PostVotesController < ApplicationController
def create
end
def destroy
end
end

View 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

View File

@@ -0,0 +1,10 @@
class SessionsController < ApplicationController
def new
end
def create
end
def destroy
end
end

View 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

View 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

View 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

View File

@@ -0,0 +1,13 @@
class TagsController < ApplicationController
def edit
end
def index
end
def show
end
def update
end
end

View File

@@ -0,0 +1,13 @@
class UnapprovalsController < ApplicationController
def new
end
def index
end
def create
end
def destroy
end
end

View File

@@ -0,0 +1,10 @@
class UploadsController < ApplicationController
def new
end
def show
end
def create
end
end

View 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

View 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

View File

@@ -0,0 +1,4 @@
class WikiPageVersionsController < ApplicationController
def index
end
end

View 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