Sha256: 81f36e49f8ca418696cd6bb081923ef9556454eb4916d7f19ca4f3378d3138ab

Contents?: true

Size: 1.01 KB

Versions: 27

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

module Locomotive
  module Concerns
    module ContentEntry
      describe Csv do
        before(:each) do
          allow_any_instance_of(Locomotive::Site).to receive(:create_default_pages!).and_return(true)
          @content_type = FactoryGirl.build(:content_type)
          @content_type.entries_custom_fields.build label: 'Title', type: 'string'
          @content_type.entries_custom_fields.build label: 'Description', type: 'text'
          @content_type.entries_custom_fields.build label: 'Visible ?', type: 'boolean', name: 'visible'
          @content_type.valid?
          @content_type.send(:set_label_field)
          @content_type.save!
        end

        it 'exports nil fields as empty strings' do
          @entry = @content_type.entries.create!({
            title: 'Locomotive',
            visible: true
          })

          values = @entry.to_values
          expect(values).to eq(['Locomotive', '', true, I18n.l(@entry.created_at, format: :long)])
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
locomotivecms-3.3.0 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.3.0.rc3 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.3.0.rc2 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.1.2 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.2.1 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.3.0.rc1 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.2.0 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.2.0.rc2 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.2.0.rc1 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.1.1 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.1.0 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.1.0.rc3 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.1.0.rc2 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.1.0.rc1 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.0.1 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.0.0 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.0.0.rc7 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.0.0.rc6 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.0.0.rc5 spec/models/locomotive/concerns/content_entry/csv_spec.rb
locomotivecms-3.0.0.rc4 spec/models/locomotive/concerns/content_entry/csv_spec.rb