Sha256: 1fa5286169616f0f5b91c6d0a780770a4bdbb866e76ade706a210a8629a5f1bd

Contents?: true

Size: 772 Bytes

Versions: 2

Compression:

Stored size: 772 Bytes

Contents

require 'active_element'
require_relative 'dummy/config/environment'

RSpec::Documentation.configure do |config|
  ActiveRecord::Migration.class_eval do
    drop_table :users
  rescue ActiveRecord::StatementInvalid
    # Skip
  end

  ActiveRecord::Migration.class_eval do
    create_table :users do |t|
      t.string :name
      t.string :email
      t.text :overview
    end
  end

  config.context do |context|
    class StubbedController < ActiveElement::ApplicationController

      def initialize(*args, &block)
        append_view_path File.expand_path(File.join(__dir__, '../app/views/'))

        super
      end

      def params
        {}
      end
    end

    context.active_element_component = ActiveElement::Component.new(StubbedController.new)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_element-0.0.3 rspec-documentation/spec_helper.rb
active_element-0.0.2 rspec-documentation/spec_helper.rb