Sha256: c354db88a9724c648d5f468f2d394732b755db0590453f95a0a52237ab5bd12c

Contents?: true

Size: 432 Bytes

Versions: 3

Compression:

Stored size: 432 Bytes

Contents

require 'test_helper'

class ViewTest < ActiveSupport::TestCase
  class TestConstructor < Prospecto::View
    accepts :name, :age
  end

  test "auto generates a constructor" do
    assert TestConstructor.new(:name => "Bob", :age => 44).present?
  end

  test "auto generates attr_readers" do
    person = TestConstructor.new(:name => "Bob", :age => 44)
    assert_equal person.name, "Bob"
    assert_equal person.age, 44
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
prospecto-0.1.3 test/view_test.rb
prospecto-0.1.1 test/view_test.rb
prospecto-0.0.9 test/view_test.rb