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-2.2.0.rc spec/helpers/reflection_helper_spec.rb
formtastic-2.1.1 spec/helpers/reflection_helper_spec.rb
formtastic-2.1.0 spec/helpers/reflection_helper_spec.rb
formtastic-2.1.0.rc spec/helpers/reflection_helper_spec.rb
formtastic-2.1.0.beta1 spec/helpers/reflection_helper_spec.rb
formtastic-2.0.2 spec/helpers/reflection_helper_spec.rb
formtastic-2.0.1 spec/helpers/reflection_helper_spec.rb
formtastic-2.0.0 spec/helpers/reflection_helper_spec.rb
formtastic-2.0.0.rc5 spec/helpers/reflection_helper_spec.rb
formtastic-2.0.0.rc4 spec/helpers/reflection_helper_spec.rb