Sha256: 95d1a642dcf69eddb4661dceb24b6ff17e66793e154682d8e19f8e79b5a59c2d

Contents?: true

Size: 704 Bytes

Versions: 17

Compression:

Stored size: 704 Bytes

Contents

require 'spec_helper'

if ruby?
class TestController < ActionController::Base; end

RSpec.describe TestController, type: :controller do
  render_views

  describe '#render_component' do
    controller do

      layout "test_layout"

      def index
        render_component
      end

      def new
        render_component "Index", {}, layout: :explicit_layout
      end
    end

    it 'renders with the default layout' do
      get :index, no_prerender: true
      expect(response).to render_template(layout: :test_layout)
    end

    it "renders with a specified layout" do
      get :new, no_prerender: true
      expect(response).to render_template(layout: :explicit_layout)
    end
  end
end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hyper-react-0.12.7 spec/controller_helper_spec.rb
hyper-react-0.12.6 spec/controller_helper_spec.rb
hyper-react-0.12.5 spec/controller_helper_spec.rb
hyper-react-0.12.4 spec/controller_helper_spec.rb
hyper-react-0.12.3 spec/controller_helper_spec.rb
hyper-react-0.12.2 spec/controller_helper_spec.rb
hyper-react-0.12.1 spec/controller_helper_spec.rb
hyper-react-0.12.0 spec/controller_helper_spec.rb
hyper-react-0.11.0 spec/controller_helper_spec.rb
hyper-react-0.10.0 spec/controller_helper_spec.rb
reactrb-0.9.0 spec/controller_helper_spec.rb
reactrb-0.8.8 spec/controller_helper_spec.rb
reactrb-0.8.7 spec/controller_helper_spec.rb
reactrb-0.8.6 spec/controller_helper_spec.rb
reactrb-0.8.5 spec/controller_helper_spec.rb
reactrb-0.8.4 spec/controller_helper_spec.rb
reactrb-0.8.3 spec/controller_helper_spec.rb