Skip to content

Releases: nepalez/fixturama

Add objects counter to seed fixtures

22 May 06:28
Compare
Choose a tag to compare

Use the :count key to create several objects at once:

---
- type: user
  count: 2
  trait:
    - customer

It is set to 1 by default.

You can assign it either zero or negative value with the same effect: no objects will be created. This can be useful for seed parameterization.

---
- type: user
  count: <%= count %>
  trait:
    - customer

Configure starting ids of database tables

04 May 08:55
Compare
Choose a tag to compare
# /spec/rails_helper.rb
RSpec.configure do |config|
  config.before(:suite) { Fixturama.start_ids_from 1_000_000 }
end

Support stubbing by arguments

27 Apr 06:32
Compare
Choose a tag to compare
  ---
  - class: Balance
    chain: debet
    arguments: 0
    actions:
      - return: 1

  - class: Balance
    chain: debet
    arguments: 1
    actions:
      - return: 0
      - raise: UnsifficientFunds

  - class: Balance
    chain: debet
    arguments: 2
    actions:
      - raise: UnsifficientFunds

The first public release

03 Feb 15:56
Compare
Choose a tag to compare

Contains features extracted from the production app, namely the helpers:

  • load_fixture
  • stub_fixture
  • seed_fixture