Sha256: a44cc655dbd535156b1b9c6288bd94a064009335ccf3405197c23965d6f2ed15

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

require 'spec_helper'

describe 'SeedExt' do

  context "when truncation!" do
    before { User.truncation! }
    it "record's count should == 0" do
      User.count.should == 0
    end
  end

  describe "truncation" do
    context "when load from csv" do
      before { User.truncation(:csv, "spec/db/seeds") }
      it "should seed data" do
        User.count.should == 2
        User.find(1).name == '$BC4Ev<T(B1'
        User.find(2).sex == 0
      end
    end
    context "when load from yml" do
      before { User.truncation(:yml, "spec/db/seeds") }
      it "should seed data" do
        User.count.should == 2
        User.find(3).name == '$BC4Ev<T(B3'
        User.find(4).sex == 1
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
seed_ext-0.0.1 spec/seed_ext_spec.rb