Sha256: c1081a8381b0b248fa7e7582adb81e28f52cea043df53c9e24d51208a2e93d8e

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

require 'spec_helper'

RSpec.describe Apress::Documentation::DocumentsHelper, type: :helper do
  include Rails.application.routes.url_helpers

  describe '#document_url_with_swagger' do
    let(:document) { Apress::Documentation::Storage::Document.new('test') }
    let(:swagger_document) { Apress::Documentation::Storage::SwaggerDocument.new(document, 'test') }
    it 'returns url for document' do
      expect(helper.document_url_with_swagger(document)).to match('/documentation/test')
    end

    it 'returns url for swagger document' do
      expect(helper.document_url_with_swagger(swagger_document)).to match('/documentation/test#!/test/')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apress-documentation-0.4.0 spec/helpers/apress/documentation/documents_helper_spec.rb