Sha256: 0e9ce7ca6ff70c8f46b287a988cb1980ccd5549666b33d8d53e7f1be22f8039c

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 Bytes

Contents

#require File.dirname(__FILE__) + '/../../test_helper'
require 'test_helper'

class Ccls::RoleTest < ActiveSupport::TestCase

	assert_should_act_as_list(:model => 'Role')
	assert_should_require(:name,
		:model => 'Role')
	assert_should_require_unique(:name,
		:model => 'Role')
	assert_should_habtm(:users,
		:model => 'Role')

	test "should create role" do
		assert_difference('Role.count',1) do
			object = create_object
			assert !object.new_record?, 
				"#{object.errors.full_messages.to_sentence}"
		end 
	end

protected

	def create_object(options = {})
		record = Factory.build(:role,options)
		record.save
		record
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ccls-ccls_engine-3.11.0 generators/ccls_engine/templates/unit/role_test.rb