Sha256: db2322a6334ef9cb4d2a796ce6020779cd75b2e5c0e209ca8f98dd763745b9a2

Contents?: true

Size: 921 Bytes

Versions: 4

Compression:

Stored size: 921 Bytes

Contents

require 'test_helper'

class <%= nom_clase %>Test < ActiveSupport::TestCase

  PRUEBA_<%= nom_clase.upcase %> = {
    nombre: "<%= nom_clase.capitalize %>",
    fechacreacion: "<%= Date.today.to_s %>",
    created_at: "<%= Date.today.to_s %>"
  }

  test "valido" do
    <%= nom_clase.downcase %> = ::<%= nom_clase.capitalize %>.create(
      PRUEBA_<%= nom_clase.upcase %>)
    assert(<%= nom_clase.downcase %>.valid?)
    <%= nom_clase.downcase %>.destroy
  end

  test "no valido" do
    <%= nom_clase.downcase %> = ::<%= nom_clase.capitalize %>.new(
      PRUEBA_<%= nom_clase.upcase %>)
    <%= nom_clase.downcase %>.nombre = ''
    assert_not(<%= nom_clase.downcase %>.valid?)
    <%= nom_clase.downcase %>.destroy
  end

  test "existente" do
    skip
    <%= nom_clase.downcase %> = ::<%= nom_clase.capitalize %>.where(id: 0).take
    assert_equal(<%= nom_clase.downcase %>.nombre, "SIN INFORMACIÓN")
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
msip-2.2.0.beta1 lib/generators/msip/templates/tablabasica_test.rb.erb
msip-2.2.0.alfa3 lib/generators/msip/templates/tablabasica_test.rb.erb
msip-2.2.0.alfa2 lib/generators/msip/templates/tablabasica_test.rb.erb
msip-2.2a2 lib/generators/msip/templates/tablabasica_test.rb.erb