Sha256: f2b6bcb983ae8f61e5df174f8c207770327bbd791f33202955a30c3d35cd4837

Contents?: true

Size: 706 Bytes

Versions: 1

Compression:

Stored size: 706 Bytes

Contents

require 'spec_helper'

describe RailsAdmin::Config::Fields::Types::CKEditor do
  describe 'base_location' do
    before do
      @custom_prefix = '/foo'
      @default_prefix = Rails.application.config.assets.prefix
      Rails.application.config.assets.prefix = @custom_prefix
      RailsAdmin.config FieldTest do
        field :text_field, :ck_editor
      end
    end

    after do
      Rails.application.config.assets.prefix = @default_prefix
    end

    it 'allows custom assets prefix' do
      expect(
        RailsAdmin.config(FieldTest).fields.find{|f| f.name == :text_field}.with(object: FieldTest.new).base_location[0..(@custom_prefix.length-1)]
      ).to eq @custom_prefix
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_admin-0.5.0 spec/rails_admin/config/fields/types/ck_editor_spec.rb