Sha256: 1a6175aa75d239642208a84d92efbf972a03005e3f1fd34a4952663a90107a48
Contents?: true
Size: 816 Bytes
Versions: 8
Compression:
Stored size: 816 Bytes
Contents
module MiniTestSpecRails module SharedTestCaseBehavior extend ActiveSupport::Concern included do before { setup_dummy_schema } let(:app) { Dummy::Application } let(:user_ken) { User.create! email: 'ken@metaskills.net' } let(:user_post) { Post.create! title: 'Test Title', body: 'Test body. Test body.', user: user_ken } end private def rails5? Rails.version >= '5.0' end def setup_dummy_schema ActiveRecord::Base.class_eval do connection.instance_eval do create_table :users, force: true do |t| t.string :email end create_table :posts, force: true do |t| t.string :title, :body t.integer :user_id end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems