Sha256: 479e48b65c52a353881e1dcb7c3083a042c0b19de6068407dcbd963733fbc2d8

Contents?: true

Size: 619 Bytes

Versions: 6

Compression:

Stored size: 619 Bytes

Contents

require 'spec_helper'
require_relative '<%= config[:relative_view_path] %>'

describe <%= config[:app] %>::Views::<%= config[:controller] %>::<%= config[:action] %> do
  let(:exposures) { Hash[foo: 'bar'] }
  let(:template)  { Hanami::View::Template.new('<%= config[:template_path] %>') }
  let(:view)      { <%= config[:app] %>::Views::<%= config[:controller] %>::<%= config[:action] %>.new(template, exposures) }
  let(:rendered)  { view.render }

  it 'exposes #foo' do
    skip 'This is an auto-generated test. Edit it and add your own tests.'

    # Example
    view.foo.must_equal exposures.fetch(:foo)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hanami-1.0.0 lib/hanami/generators/action/view_spec.minitest.tt
hanami-1.0.0.rc1 lib/hanami/generators/action/view_spec.minitest.tt
hanami-1.0.0.beta3 lib/hanami/generators/action/view_spec.minitest.tt
hanami-1.0.0.beta2 lib/hanami/generators/action/view_spec.minitest.tt
hanami-1.0.0.beta1 lib/hanami/generators/action/view_spec.minitest.tt
hanami-0.9.2 lib/hanami/generators/action/view_spec.minitest.tt