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

Version Path
fesplugas-typus-0.9.0 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.1 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.10 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.11 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.12 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.13 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.14 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.15 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.16 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.17 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.2 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.3 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.4 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.5 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.6 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.7 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.8 test/functional/admin/status_controller_test.rb
fesplugas-typus-0.9.9 test/functional/admin/status_controller_test.rb
typus-0.9.27 test/functional/admin/status_controller_test.rb
typus-0.9.26 test/functional/admin/status_controller_test.rb