Sha256: 3899c1dda3f561fbca70f2b570e5e9c77e5409e66a21101af17877ebb52d7baa

Contents?: true

Size: 757 Bytes

Versions: 14

Compression:

Stored size: 757 Bytes

Contents

require "test_helper"

class Article; extend ActiveModel::Naming; end

module Godmin
  module Authorization
    class PolicyFinderTest < ActiveSupport::TestCase
      def test_find_by_model
        namespaced_as "namespace" do
          policy = PolicyFinder.find(Article)
          assert_equal "Namespace::ArticlePolicy", policy
        end
      end

      def test_find_by_class
        namespaced_as "namespace" do
          policy = PolicyFinder.find(Object)
          assert_equal "Namespace::ObjectPolicy", policy
        end
      end

      def test_find_by_symbol
        namespaced_as "namespace" do
          policy = PolicyFinder.find(:article)
          assert_equal "Namespace::ArticlePolicy", policy
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
godmin-0.10.3 test/lib/godmin/policy_finder_test.rb
godmin-0.10.2 test/lib/godmin/policy_finder_test.rb
godmin-0.10.1 test/lib/godmin/policy_finder_test.rb
godmin-0.10.0 test/lib/godmin/policy_finder_test.rb
godmin-0.9.9 test/lib/godmin/policy_finder_test.rb
godmin-0.9.8 test/lib/godmin/policy_finder_test.rb
godmin-0.9.7 test/lib/godmin/policy_finder_test.rb
godmin-0.9.6 test/lib/godmin/policy_finder_test.rb
godmin-0.9.5 test/lib/godmin/policy_finder_test.rb
godmin-0.9.4 test/lib/godmin/policy_finder_test.rb
godmin-0.9.3 test/lib/godmin/policy_finder_test.rb
godmin-0.9.2 test/lib/godmin/policy_finder_test.rb
godmin-0.9.1 test/lib/godmin/policy_finder_test.rb
godmin-0.9.0 test/lib/godmin/policy_finder_test.rb