require "test_helper"
-require "redactions_controller"
class RedactionsControllerTest < ActionController::TestCase
##
session[:user] = create(:user).id
get :new
- assert_response :forbidden
+ assert_response :redirect
+ assert_redirected_to :controller => "errors", :action => "forbidden"
end
def test_create_moderator
session[:user] = create(:user).id
post :create, :params => { :redaction => { :title => "Foo", :description => "Description here." } }
- assert_response :forbidden
+ assert_response :redirect
+ assert_redirected_to :controller => "errors", :action => "forbidden"
end
def test_destroy_moderator_empty
session[:user] = create(:user).id
delete :destroy, :params => { :id => create(:redaction).id }
- assert_response :forbidden
+ assert_response :redirect
+ assert_redirected_to :controller => "errors", :action => "forbidden"
end
def test_edit
session[:user] = create(:user).id
get :edit, :params => { :id => create(:redaction).id }
- assert_response :forbidden
+ assert_response :redirect
+ assert_redirected_to :controller => "errors", :action => "forbidden"
end
def test_update_moderator
redaction = create(:redaction)
put :update, :params => { :id => redaction.id, :redaction => { :title => "Foo", :description => "Description here." } }
- assert_response :forbidden
+ assert_response :redirect
+ assert_redirected_to :controller => "errors", :action => "forbidden"
end
end