1
0
Fork 0
mirror of https://github.com/varvet/pundit.git synced 2022-11-09 12:30:11 -05:00

Add generator support for test_unit/minitest.

This commit is contained in:
John Otander 2014-04-23 14:03:40 -06:00
parent a0be3e179f
commit ab536852e0
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,11 @@
module TestUnit
module Generators
class PolicyGenerator < ::Rails::Generators::NamedBase
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
def create_policy_test
template 'policy_test.rb', File.join('test/policies', class_path, "#{file_name}_policy_test.rb")
end
end
end
end

View file

@ -0,0 +1,19 @@
require 'test_helper'
class <%= class_name %>PolicyTest < ActiveSupport::TestCase
def test_scope
end
def test_create
end
def test_show
end
def test_update
end
def test_destroy
end
end