Sha256: afeb148951c12bcf3cac10af3560c27f73a9da052738914e2da20a914d9384b3

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Caramelize::Services::PageBuilder do
  describe '.build_namespace_overview' do
    subject(:page) { described_class.build_namespace_overview(namespaces) }

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

    it 'returns page with expected title' do
      expect(page.title).to eql(expected_page.title)
    end

    it 'returns page with expected page body' do
      expect(page.body).to eql(expected_page.body)
    end

    it 'returns page with expected page latest' do
      expect(page.latest).to eql(expected_page.latest)
    end

    it 'returns page with expected message' do
      expect(page.message).to eql(expected_page.message)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
caramelize-1.3.1 spec/lib/caramelize/services/page_builder_spec.rb
caramelize-1.3.0 spec/lib/caramelize/services/page_builder_spec.rb
caramelize-1.2.1 spec/lib/caramelize/services/page_builder_spec.rb
caramelize-1.2.0 spec/lib/caramelize/services/page_builder_spec.rb