Sha256: c0061bffce06b4400620ab786db215a7a930736329aa3f378d4faf760825e61f

Contents?: true

Size: 1.59 KB

Versions: 48

Compression:

Stored size: 1.59 KB

Contents

require 'test_helper'

module Incline

  class AccessTestControllerTest < ::ActionDispatch::IntegrationTest

    def setup
      # basic user and admin user.
      @user = incline_users(:basic)
      @admin = incline_users(:admin)

      # group member.
      group = incline_access_groups(:one)
      @member = incline_users(:one)
      @member.groups = [ group ]

    end

    access_tests_for :allow_anon,
                     allow_anon: true,
                     allow_any_user: true,
                     allow_admin: true,
                     url_helper: 'incline.test_allow_anon_path'

    access_tests_for :require_anon,
                     allow_anon: true,
                     allow_any_user: false,
                     allow_admin: false,
                     url_helper: 'incline.test_require_anon_path',
                     failure: 'incline.user_path(user)'

    access_tests_for :require_admin,
                     allow_anon: false,
                     allow_any_user: false,
                     allow_admin: true,
                     url_helper: 'incline.test_require_admin_path'

    access_tests_for :require_user,
                     allow_anon: false,
                     allow_any_user: true,
                     allow_admin: true,
                     url_helper: 'incline.test_require_user_path'

    access_tests_for :require_group,
                     allow_anon: false,
                     allow_any_user: false,
                     allow_admin: true,
                     allow_groups: [ 'Group 1' ],
                     url_helper: 'incline.test_require_group_path'

  end

end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
incline-0.3.14 test/controllers/incline/access_test_controller_test.rb
incline-0.3.13 test/controllers/incline/access_test_controller_test.rb
incline-0.3.12 test/controllers/incline/access_test_controller_test.rb
incline-0.3.11 test/controllers/incline/access_test_controller_test.rb
incline-0.3.10 test/controllers/incline/access_test_controller_test.rb
incline-0.3.9 test/controllers/incline/access_test_controller_test.rb
incline-0.3.8 test/controllers/incline/access_test_controller_test.rb
incline-0.3.7 test/controllers/incline/access_test_controller_test.rb
incline-0.3.6 test/controllers/incline/access_test_controller_test.rb
incline-0.3.5 test/controllers/incline/access_test_controller_test.rb
incline-0.3.4 test/controllers/incline/access_test_controller_test.rb
incline-0.3.3 test/controllers/incline/access_test_controller_test.rb
incline-0.3.2 test/controllers/incline/access_test_controller_test.rb
incline-0.3.1 test/controllers/incline/access_test_controller_test.rb
incline-0.3.0 test/controllers/incline/access_test_controller_test.rb
incline-0.2.36 test/controllers/incline/access_test_controller_test.rb
incline-0.2.35 test/controllers/incline/access_test_controller_test.rb
incline-0.2.34 test/controllers/incline/access_test_controller_test.rb
incline-0.2.28 test/controllers/incline/access_test_controller_test.rb
incline-0.2.27 test/controllers/incline/access_test_controller_test.rb