Sha256: fd5bf679698fe58165a563c59a754f02b080a8150929237de7ec74d7967d2f5c

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

# encoding: UTF-8

require "test_helper"

class SpecialistDocumentEditionTest < ActiveSupport::TestCase
  should "have correct fields" do
    fields = {
      slug: 'cma-cases/merger-investigation-2014',
      title: "Merger Investigation 2014",
      summary: "This is the summary of stuff going on in the Merger Investigation 2014",
      state: "published"
    }

    edition = SpecialistDocumentEdition.new(fields)

    assert_equal fields[:title], edition.title
  end

  should "be persistable" do
    edition = SpecialistDocumentEdition.create!(
      slug: 'cma-cases/merger-investigation-2014',
      title: "Merger Investigation 2014",
      summary: "This is the summary of stuff going on in the Merger Investigation 2014",
      body: "A body",
      opened_date: '2012-04-21',
      market_sector: 'oil-and-gas',
      case_type: 'some-case-type',
      case_state: 'open',
      state: "published",
      document_id: 'a-document-id'
    )

    found = SpecialistDocumentEdition.where(slug: edition.slug).first
    assert_equal found.attributes, edition.attributes
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
govuk_content_models-8.3.1 test/models/specialist_document_edition_test.rb
govuk_content_models-8.3.0 test/models/specialist_document_edition_test.rb
govuk_content_models-8.2.0 test/models/specialist_document_edition_test.rb
govuk_content_models-8.1.0 test/models/specialist_document_edition_test.rb
govuk_content_models-8.0.0 test/models/specialist_document_edition_test.rb
govuk_content_models-7.3.1 test/models/specialist_document_edition_test.rb