Sha256: 2211b32a0d4cfb676acee629f5143c076383d68c55e2c2611d99f3aa5dde2f9e

Contents?: true

Size: 897 Bytes

Versions: 2

Compression:

Stored size: 897 Bytes

Contents

require 'active_record'
require 'sqlite3'
require 'mortadella'
require 'active_cucumber'
require 'factory_girl'
require 'faker'
require 'kappamaki'
require 'rspec/collection_matchers'


ActiveRecord::Base.establish_connection(
  adapter: 'sqlite3',
  database: ':memory:'
)


ActiveRecord::Schema.define do
  create_table :shows, force: true do |t|
    t.string :name
    t.datetime 'created_at'
  end

  create_table :episodes, force: true do |t|
    t.belongs_to :show, index: true
    t.string :name
    t.integer :year
    t.datetime 'created_at'
  end
end


FactoryGirl.define do
  factory :show do
    name { Faker::Book.title }
  end

  factory :episode do
    name { Faker::Book.title }
    year { 1960 + rand(40) }
    show
  end
end


Before do
  Show.delete_all
  Episode.delete_all
  @error_checked = false
end

After do
  expect(@error_happened).to be false unless @error_checked
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_cucumber-0.0.3 features/support/env.rb
active_cucumber-0.0.2 features/support/env.rb