Sha256: 8479e2d3b2811544d270e128f4890f239073ef63b634b30a7db5ca6bf000ed2a

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

RSpec.describe 'Formtastic::Helpers::Reflection' do

  include FormtasticSpecHelper

  before do
    @output_buffer = ''
    mock_everything
  end

  class ReflectionTester
    include Formtastic::Helpers::Reflection
    def initialize(model_object)
      @object = model_object
    end
  end

  context 'with an ActiveRecord object' do
    it "should return association details on an ActiveRecord association" do
      @reflection_tester = ReflectionTester.new(@new_post)
      expect(@reflection_tester.reflection_for(:sub_posts)).not_to be_nil
    end
    it "should return association details on a MongoMapper association" do
      @reflection_tester = ReflectionTester.new(@new_mm_post)
      expect(@reflection_tester.reflection_for(:sub_posts)).not_to be_nil
    end
  end
  
  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/spec/helpers/reflection_helper_spec.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/spec/helpers/reflection_helper_spec.rb
formtastic-4.0.0 spec/helpers/reflection_helper_spec.rb
formtastic-4.0.0.rc1 spec/helpers/reflection_helper_spec.rb