Sha256: c03aa3989586665771b6627143d321c1da2e7e39f4b16ba00d6866f4724a3bb8

Contents?: true

Size: 947 Bytes

Versions: 5

Compression:

Stored size: 947 Bytes

Contents

#          Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the MIT license.

require File.expand_path('../../../../spec/helper', __FILE__)

Ramaze::App.options.merge!(:layouts => 'view')

class SpecActionlessTemplates < Ramaze::Controller
  map '/'
  trait :needs_method => true
  alias_view :non_existant_method, :list
end

class SpecActionlessTemplatesLayout < Ramaze::Controller
  map '/other'
  layout 'other_wrapper'
  map_layouts '/'
  trait :needs_method => true

  def index
    "Others Hello"
  end
end

describe "Testing Actionless Templates" do
  behaves_like :rack_test

  it "should not find template file for non existant method" do
    get('/list').status.should == 404
    get('/non_existant_method').status.should == 404
  end

  it "should render layout(without method) for normal action" do
    get('/other').body.should == '<p>Others Hello</p>'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ramaze-2023.01.06 spec/ramaze/controller/actionless_templates.rb
ramaze-2012.12.08 spec/ramaze/controller/actionless_templates.rb
ramaze-2012.12.08b spec/ramaze/controller/actionless_templates.rb
ramaze-2012.04.14 spec/ramaze/controller/actionless_templates.rb
ramaze-2012.03.07 spec/ramaze/controller/actionless_templates.rb