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.2.26 test/controllers/incline/access_test_controller_test.rb
incline-0.2.25 test/controllers/incline/access_test_controller_test.rb
incline-0.2.24 test/controllers/incline/access_test_controller_test.rb
incline-0.2.23 test/controllers/incline/access_test_controller_test.rb
incline-0.2.22 test/controllers/incline/access_test_controller_test.rb
incline-0.2.21 test/controllers/incline/access_test_controller_test.rb
incline-0.2.20 test/controllers/incline/access_test_controller_test.rb
incline-0.2.19 test/controllers/incline/access_test_controller_test.rb
incline-0.2.18 test/controllers/incline/access_test_controller_test.rb
incline-0.2.17 test/controllers/incline/access_test_controller_test.rb
incline-0.2.16 test/controllers/incline/access_test_controller_test.rb
incline-0.2.15 test/controllers/incline/access_test_controller_test.rb
incline-0.2.14 test/controllers/incline/access_test_controller_test.rb
incline-0.2.13 test/controllers/incline/access_test_controller_test.rb
incline-0.2.12 test/controllers/incline/access_test_controller_test.rb
incline-0.2.11 test/controllers/incline/access_test_controller_test.rb
incline-0.2.10 test/controllers/incline/access_test_controller_test.rb
incline-0.2.9 test/controllers/incline/access_test_controller_test.rb
incline-0.2.8 test/controllers/incline/access_test_controller_test.rb
incline-0.2.7 test/controllers/incline/access_test_controller_test.rb