Sha256: b3a2ced027cbe6f3af5fdc8d19933214862d9bed99e5bc50e4a229fc4d25fb76
Contents?: true
Size: 717 Bytes
Versions: 44
Compression:
Stored size: 717 Bytes
Contents
require_relative '../test_helper' class <%= class_name %>Test < ActiveSupport::TestCase def test_fixtures_validity <%= class_name %>.all.each do |<%= file_name %>| assert <%= file_name %>.valid?, <%= file_name %>.errors.inspect end end def test_validation <%= file_name %> = <%= class_name %>.new assert <%= file_name %>.invalid? assert_equal [<%= model_attrs.collect{|attr| ":#{attr.name}"}.join(', ')%>], <%= file_name %>.errors.keys end def test_creation assert_difference '<%= class_name %>.count' do <%= class_name %>.create( <%- model_attrs.each do |attr| -%> <%= attr.name %>: 'test <%= attr.name %>', <%- end -%> ) end end end
Version data entries
44 entries across 44 versions & 7 rubygems