Sha256: 33cbf2b8416cc12d6e4494aaf7ec27da60706793995c88c1384b36371932be0e

Contents?: true

Size: 1000 Bytes

Versions: 62

Compression:

Stored size: 1000 Bytes

Contents

require 'test_helper'

module Workarea
  module Admin
    class ContentPresetsIntegrationTest < Workarea::IntegrationTest
      include Admin::IntegrationTest

      def test_preset_creation
        content = create_content
        block = content.blocks.create!(
          type: 'html',
          data: { html: 'test_html' }
        )

        post admin.content_presets_path,
          params: {
            content_preset: { name: 'Foo Bar' },
            content_id: content.id,
            block_id: block.id
          },
          xhr: true

        preset = Content::Preset.first
        assert_response(:created)
        assert_equal('Foo Bar', preset.name)
        assert_equal(:html, preset.type_id)
        assert_equal({ 'html' => 'test_html' }, preset.data)
      end

      def test_preset_deletion
        preset = Content::Preset.create!(name: 'Test Preset')

        delete admin.content_preset_path(preset)
        assert_equal(0, Content::Preset.count)
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-admin-3.5.27 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.26 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.45 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.25 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.23 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.44 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.22 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.43 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.21 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.42 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.20 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.41 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.19 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.40 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.18 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.39 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.17 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.38 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.5.16 test/integration/workarea/admin/content_presets_integration_test.rb
workarea-admin-3.4.37 test/integration/workarea/admin/content_presets_integration_test.rb