Sha256: 5f2779cfbd1e2f649813dcd48fedaee4ecce4369cddf037b55fc2ac166d903eb

Contents?: true

Size: 772 Bytes

Versions: 7

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

7 entries across 7 versions & 1 rubygems

Version Path
active_element-0.0.10 rspec-documentation/spec_helper.rb
active_element-0.0.9 rspec-documentation/spec_helper.rb
active_element-0.0.8 rspec-documentation/spec_helper.rb
active_element-0.0.7 rspec-documentation/spec_helper.rb
active_element-0.0.6 rspec-documentation/spec_helper.rb
active_element-0.0.5 rspec-documentation/spec_helper.rb
active_element-0.0.4 rspec-documentation/spec_helper.rb