Sha256: 2f19cc76c8e94c862388b57c8dd2c60c636873010fd18b90514380e28f29752c

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

require 'rails_helper'

describe Pulitzer::CloneVersion do
  let(:post_type)   { Pulitzer::PostType.named('Welcome')}
  let(:post)        { post_type.posts.first }
  let(:version)     { post.preview_version }

  it 'Clones version content elements' do
    expect(version.content_elements.size).to eq 11
    version.post.create_processing_version
    new_version = Pulitzer::CloneVersion.new(version).call
    expect(new_version.content_elements.size).to eq 11
  end

  it 'Clones version free form sections' do
    expect(version.free_form_sections.size).to eq 2
    version.post.create_processing_version
    new_version = Pulitzer::CloneVersion.new(version).call
    expect(new_version.free_form_sections.size).to eq 2
  end

  it 'Clones a valid content element' do
    version.post.create_processing_version
    new_version = Pulitzer::CloneVersion.new(version).call
    content_element = new_version.content_elements.first
    expect(content_element.label).to match "Hero Title 1"
    expect(content_element.type.to_s).to match "text"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pulitzer-0.15.0 spec/interactions/clone_version_spec.rb
pulitzer-0.14.4 spec/interactions/clone_version_spec.rb
pulitzer-0.14.3 spec/interactions/clone_version_spec.rb