Sha256: 27219f12b7a659dbe4290699f3dda48b3eab6429017d620f8532e19bd6e61f8e

Contents?: true

Size: 813 Bytes

Versions: 13

Compression:

Stored size: 813 Bytes

Contents

# encoding: utf-8
#
RSpec.shared_examples 'Specialized Class Finder' do
  let(:builder) { Formtastic::FormBuilder.allocate }
  subject(:finder) { described_class.new(builder) }

  context 'by default' do
    it 'includes Object and the default namespaces' do
      expect(finder.namespaces).to eq([Object, default])
    end
  end

  context 'with namespace configuration set to a custom list of modules' do
    before do
      stub_const('CustomModule', Module.new)
      stub_const('AnotherModule', Module.new)

      allow(Formtastic::FormBuilder).to receive(namespaces_setting)
                                          .and_return([ CustomModule, AnotherModule ])
    end

    it 'includes just the custom namespaces' do
      expect(finder.namespaces).to eq([CustomModule, AnotherModule])
    end
  end

end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/spec/support/specialized_class_finder_shared_example.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/formtastic-4.0.0/spec/support/specialized_class_finder_shared_example.rb
formtastic-4.0.0 spec/support/specialized_class_finder_shared_example.rb
formtastic-4.0.0.rc1 spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.5 spec/support/specialized_class_finder_shared_example.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/formtastic-3.1.4/spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.4 spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.3 spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.2 spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.1 spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.0 spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.0.rc2 spec/support/specialized_class_finder_shared_example.rb
formtastic-3.1.0.rc1 spec/support/specialized_class_finder_shared_example.rb