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