Sha256: 77fb86372e474d8101b07c4e77ca8b6d83acfc6bd4e54bd7745ca61c2b759b65

Contents?: true

Size: 453 Bytes

Versions: 7

Compression:

Stored size: 453 Bytes

Contents

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

RSpec.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)      { described_class.new(template, exposures) }
  let(:rendered)  { view.render }

  it 'exposes #foo' do
    expect(view.foo).to eq exposures.fetch(:foo)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hanami-0.9.1 lib/hanami/generators/action/view_spec.rspec.tt
hanami-0.9.0 lib/hanami/generators/action/view_spec.rspec.tt
hanami-0.8.0 lib/hanami/generators/action/view_spec.rspec.tt
hanami-0.7.3 lib/hanami/generators/action/view_spec.rspec.tt
hanami-0.7.2 lib/hanami/generators/action/view_spec.rspec.tt
hanami-0.7.1 lib/hanami/generators/action/view_spec.rspec.tt
hanami-0.7.0 lib/hanami/generators/action/view_spec.rspec.tt