Sha256: 99a74d29d118e90bd01c5276f09bdfafd31158ac26db106b7c94cd85f8d8534d

Contents?: true

Size: 1015 Bytes

Versions: 4

Compression:

Stored size: 1015 Bytes

Contents

require 'spec_helper'

describe Caramelize::Service::Pagebuilder do
  describe '.build_namespace_overview' do
    let(:body) do
      "## Overview of namespaces\n\n* [[Velociraptor|velociraptors/Wiki]]  \n* [[Allosaurus|allosaurus/Wiki]]  \n"
    end
    let(:expected_page) do
      Caramelize::Page.new(title: 'Home',
                            body: body,
                            message: 'Create Namespace Overview',
                            latest: true)
    end
    let(:namespaces) do
      [
        OpenStruct.new(identifier: 'velociraptors', name: 'Velociraptor'),
        OpenStruct.new(identifier: 'allosaurus', name: 'Allosaurus')
      ]
    end

    it 'returns page with expected attributes' do
      page = described_class.build_namespace_overview
      expected(page.title).to eql(expected_page.title)
      expected(page.body).to eql(expected_page.body)
      expected(page.latest).to eql(expected_page.latest)
      expected(page.message).to eql(expected_page.message)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
caramelize-1.1.1 spec/lib/caramelize/services/page_builder.rb
caramelize-1.1.0 spec/lib/caramelize/services/page_builder.rb
caramelize-1.0.0 spec/lib/caramelize/services/page_builder.rb
caramelize-0.4.0 spec/lib/caramelize/services/page_builder.rb