additional functional tests, some controller fixes

This commit is contained in:
albert
2010-12-01 18:50:04 -05:00
parent 39dd2e277a
commit 976a25a6c6
19 changed files with 185 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
class ArtistsController < ApplicationController
before_filter :member_only
before_filter :member_only, :except => [:index, :show]
def new
@artist = Artist.new_with_defaults(params)
@@ -48,7 +48,8 @@ class ArtistsController < ApplicationController
def revert
@artist = Artist.find(params[:id])
@artist.revert_to!(params[:version])
@version = ArtistVersion.find(params[:version_id])
@artist.revert_to!(@version)
redirect_to artist_path(@artist), :notice => "Artist updated"
end
end

View File

@@ -20,6 +20,8 @@ class BansController < ApplicationController
def create
@ban = Ban.new(params[:ban])
@ban.banner_id = CurrentUser.id
if @ban.save
redirect_to ban_path(@ban), :notice => "Ban created"
else
@@ -39,5 +41,6 @@ class BansController < ApplicationController
def destroy
@ban = Ban.find(params[:id])
@ban.destroy
redirect_to bans_path, :notice => "Ban destroyed"
end
end

View File

@@ -19,8 +19,7 @@ class CommentsController < ApplicationController
@comment.save
respond_with(@comment) do |format|
format.html do
flash[:notice] = "Comment posted"
redirect_to posts_path(@comment.post)
redirect_to post_path(@comment.post), :notice => "Comment posted"
end
format.js