Sha256: 2f94a6269249e51dd0642bf6f6f5cc3ead705f2ca6cabe27c75088b12eef291a

Contents?: true

Size: 1 KB

Versions: 19

Compression:

Stored size: 1 KB

Contents

require 'rails_helper'

describe Pulitzer::CreatePostContentElements do
  let(:post_type_version) { create(:post_type_version, :with_content_elements) }
  let(:post)      { create(:post, post_type_version: post_type_version) }

  it 'Copies content elements to preview version' do
    expect(post_type_version.post_type_content_element_types.size).to eq 3
    expect(post.preview_version.content_elements.size).to eq 0
    Pulitzer::CreatePostContentElements.new(post).call
    expect(post.preview_version.content_elements.size).to eq 3
  end

  it 'Copies free form sections to preview version' do
    ff_post_type = create(:post_type_version, :with_free_form_sections)
    ff_post = ff_post_type.posts.create title: 'test'
    ff_post.create_preview_version
    expect(ff_post_type.free_form_section_types.size).to eq 3
    expect(ff_post.preview_version.free_form_sections.size).to eq 0
    Pulitzer::CreatePostContentElements.new(ff_post).call
    expect(ff_post.preview_version.free_form_sections.size).to eq 3
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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