Sha256: e5f2854f6913515bd374b06e1e7a8b09707c664227309b2fe0c6628cfd33409c
Contents?: true
Size: 1.19 KB
Versions: 29
Compression:
Stored size: 1.19 KB
Contents
require 'test/helper' ## # Test resources which are not related to an ActiveRecord model. # class Admin::StatusControllerTest < ActionController::TestCase def setup @typus_user = typus_users(:admin) @request.session[:typus_user_id] = @typus_user.id end def test_should_verify_admin_can_go_to_index get :index assert_response :success assert_template 'index' end def test_should_verify_status_is_not_available_if_user_not_logged @request.session[:typus_user_id] = nil get :index assert_response :redirect assert_redirected_to admin_sign_in_path(:back_to => '/admin/status') end def test_should_verify_admin_can_not_go_to_show get :show assert_response :redirect assert_redirected_to admin_dashboard_path assert flash[:notice] assert_equal "#{@typus_user.role.capitalize} can't go to show on status.", flash[:notice] end def test_should_verify_editor_can_not_go_to_index typus_user = typus_users(:editor) @request.session[:typus_user_id] = typus_user.id get :index assert_response :redirect assert flash[:notice] assert_equal "#{typus_user.role.capitalize} can't go to index on status.", flash[:notice] end end
Version data entries
29 entries across 29 versions & 2 rubygems