Sha256: 04d428001fcf22450375f01570074a511ebd62598f0ac6035101b7ca5db38857

Contents?: true

Size: 794 Bytes

Versions: 7

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true

require "hanami"

RSpec.describe "App view / Config / Template", :app_integration do
  before do
    module TestApp
      class App < Hanami::App
        config.root = "/test_app"
      end
    end

    Hanami.app.instance_eval(&app_hook) if respond_to?(:app_hook)
    Hanami.app.register_slice :main
    Hanami.app.prepare

    module TestApp
      class View < Hanami::View
      end
    end

    module TestApp
      module Views
        module Article
          class Index < TestApp::View
          end
        end
      end
    end
  end

  subject(:template) { view_class.config.template }
  let(:view_class) { TestApp::Views::Article::Index }

  it "configures the tempalte to match the class name" do
    expect(template).to eq "article/index"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hanami-2.1.0 spec/integration/view/config/template_spec.rb
hanami-2.1.0.rc3 spec/integration/view/config/template_spec.rb
hanami-2.1.0.rc2 spec/integration/view/config/template_spec.rb
hanami-2.1.0.rc1 spec/integration/view/config/template_spec.rb
hanami-2.1.0.beta2.1 spec/integration/view/config/template_spec.rb
hanami-2.1.0.beta2 spec/integration/view/config/template_spec.rb
hanami-2.1.0.beta1 spec/integration/view/config/template_spec.rb