Sha256: 1033e9b0a9ad21cc14eb4f7ade0b37a1fba588e9313db93c1b23b497c326f3c6

Contents?: true

Size: 816 Bytes

Versions: 30

Compression:

Stored size: 816 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

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)
      @reflection_tester.reflection_for(:sub_posts).should_not be_nil
    end
    it "should return association details on a MongoMapper association" do
      @reflection_tester = ReflectionTester.new(@new_mm_post)
      @reflection_tester.reflection_for(:sub_posts).should_not be_nil
    end
  end
  
  
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
formtastic-3.1.5 spec/helpers/reflection_helper_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/formtastic-3.1.4/spec/helpers/reflection_helper_spec.rb
formtastic-3.1.4 spec/helpers/reflection_helper_spec.rb
formtastic-3.1.3 spec/helpers/reflection_helper_spec.rb
formtastic-3.1.2 spec/helpers/reflection_helper_spec.rb
formtastic-3.1.1 spec/helpers/reflection_helper_spec.rb
formtastic-3.1.0 spec/helpers/reflection_helper_spec.rb
formtastic-3.1.0.rc2 spec/helpers/reflection_helper_spec.rb
formtastic-3.1.0.rc1 spec/helpers/reflection_helper_spec.rb
formtastic-3.0.0 spec/helpers/reflection_helper_spec.rb
formtastic-3.0.0.rc2 spec/helpers/reflection_helper_spec.rb
formtastic-2.3.1 spec/helpers/reflection_helper_spec.rb
formtastic-2.3.0 spec/helpers/reflection_helper_spec.rb
formtastic-3.0.0.rc spec/helpers/reflection_helper_spec.rb
formtastic-2.3.0.rc4 spec/helpers/reflection_helper_spec.rb
formtastic-2.3.0.rc3 spec/helpers/reflection_helper_spec.rb
formtastic-2.3.0.rc2 spec/helpers/reflection_helper_spec.rb
formtastic-2.3.0.rc spec/helpers/reflection_helper_spec.rb
formtastic-2.2.1 spec/helpers/reflection_helper_spec.rb
formtastic-2.2.0 spec/helpers/reflection_helper_spec.rb