Sha256: 41c2724fdc56d5ed7696505da886c3366986c63c971e7609712b019cdfdb5b06

Contents?: true

Size: 667 Bytes

Versions: 2

Compression:

Stored size: 667 Bytes

Contents

require 'test_helper'

class MergesTest < ActiveSupport::TestCase

  setup do
    Fabricators.define do
      fabricator :user do
        name 'name'
      end
    end
  end

  test 'return attributes' do
    assert_equal 'other', attributes_for(:user, name: 'other')[:name]
  end

  test 'build instance' do
    assert_equal 'other', build(:user, name: 'other').name
    build(:user, 3, name: 'other').each do |user|
      assert_equal 'other', user.name
    end
  end

  test 'create instance' do
    assert_equal 'other', create(:user, name: 'other').name
    create(:user, 3, name: 'other').each do |user|
      assert_equal 'other', user.name
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fabricators-0.1.2 test/merges_test.rb
fabricators-0.1.1 test/merges_test.rb