additional functional tests, some controller fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user