Sha256: d399345af7c72725cfed891d2a70a8aec4d80bff58cac40d48023dd5357d3316

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Ki::Helpers do
  include Ki::Helpers

  it 'should render_haml' do
    expect(haml('%div.foo')).to eq "<div class='foo'></div>\n"
  end

  it 'renders css tag' do
    expect(css('asd')).to eq "<link href='asd' rel='stylesheet'>\n"
  end

  it 'renders js tag' do
    expect(js('asd')).to eq "<script src='asd'></script>\n"
  end

  it 'renders 404 if partial not found' do
    expect {
      partial('does_not_exist')
    }.to raise_error Ki::PartialNotFoundError
  end

  it 'renders haml' do
    expect(File).to receive(:join).and_return('lib/ki/views/404.haml')
    expect(partial('404')).to include('h1')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ki-0.4.12 spec/lib/ki/helpers_spec.rb