Sha256: 29535a862a677e0df2c1cc543d6cbbe1404e3d85ad1d8ff5a1170f86d80ca826
Contents?: true
Size: 935 Bytes
Versions: 5
Compression:
Stored size: 935 Bytes
Contents
require 'spec_helper' describe "Template renderer with dynamic layouts" do before(:each) do ApplicationController.view_paths = [ActionView::FixtureResolver.new( "spree/layouts/spree_application.html.erb" => "Default layout <%= yield %>", "spree/layouts/my_store/spree_application.html.erb" => "Store layout <%= yield %>", "application/index.html.erb" => "hello" )] end it "should render the layout corresponding to the current store" do store = FactoryGirl.create :store, code: "my_store" get "http://#{store.url}" expect(response.body).to eql("Store layout hello") end it "should fall back to the default layout if none are found for the current store" do allow(ApplicationController).to receive(:current_store).and_return(nil) get "http://www.example.com" expect(response.body).to eql("Default layout hello") end end
Version data entries
5 entries across 5 versions & 1 rubygems