Sha256: 8cd2b16cb08832981a917b8ee6605eabaeaf4ebc434e75023dab6337ccb390ea

Contents?: true

Size: 1.09 KB

Versions: 31

Compression:

Stored size: 1.09 KB

Contents

require 'rails_helper'

describe Pulitzer::CloneVersion do
  let(:post_type)   { Pulitzer::PostType.named('Welcome')}
  let(:post_type_version) {post_type.published_type_version}
  let(:post)        { post_type_version.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

31 entries across 31 versions & 1 rubygems

Version Path
pulitzer-0.15.31 spec/interactions/clone_version_spec.rb
pulitzer-0.15.30 spec/interactions/clone_version_spec.rb
pulitzer-0.15.29 spec/interactions/clone_version_spec.rb
pulitzer-0.15.28 spec/interactions/clone_version_spec.rb
pulitzer-0.15.27 spec/interactions/clone_version_spec.rb
pulitzer-0.15.26 spec/interactions/clone_version_spec.rb
pulitzer-0.15.25 spec/interactions/clone_version_spec.rb
pulitzer-0.15.24 spec/interactions/clone_version_spec.rb
pulitzer-0.15.23 spec/interactions/clone_version_spec.rb
pulitzer-0.15.22 spec/interactions/clone_version_spec.rb
pulitzer-0.15.21 spec/interactions/clone_version_spec.rb
pulitzer-0.15.20 spec/interactions/clone_version_spec.rb
pulitzer-0.15.19 spec/interactions/clone_version_spec.rb
pulitzer-0.15.18 spec/interactions/clone_version_spec.rb
pulitzer-0.15.17 spec/interactions/clone_version_spec.rb
pulitzer-0.15.16 spec/interactions/clone_version_spec.rb
pulitzer-0.15.15 spec/interactions/clone_version_spec.rb
pulitzer-0.15.14 spec/interactions/clone_version_spec.rb
pulitzer-0.15.13 spec/interactions/clone_version_spec.rb
pulitzer-0.15.12 spec/interactions/clone_version_spec.rb