Sha256: f8bdb11996ed3f4cd1f637bfebe7f94d7275ecd01971e4192666903891c27dbc

Contents?: true

Size: 583 Bytes

Versions: 4

Compression:

Stored size: 583 Bytes

Contents

require_relative '../../../spec_helper'

describe <%= app.classify %>::Views::<%= classified_controller_name %>::<%= action.classify %> do
  let(:exposures) { Hash[foo: 'bar'] }
  let(:template)  { Hanami::View::Template.new('<%= template %>') }
  let(:view)      { <%= app.classify %>::Views::<%= classified_controller_name %>::<%= action.classify %>.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

4 entries across 4 versions & 1 rubygems

Version Path
hanami-1.1.0 lib/hanami/cli/commands/generate/action/view_spec.minitest.erb
hanami-1.1.0.rc1 lib/hanami/cli/commands/generate/action/view_spec.minitest.erb
hanami-1.1.0.beta3 lib/hanami/cli/commands/generate/action/view_spec.minitest.erb
hanami-1.1.0.beta2 lib/hanami/cli/commands/generate/action/view_spec.minitest.erb