Sha256: f7780fa75bc450d3c2655f6b98939416a9848e25033c2649d907eaf940b969c1

Contents?: true

Size: 1.21 KB

Versions: 12

Compression:

Stored size: 1.21 KB

Contents

require File.join(File.dirname(__FILE__), "..", "..", "spec_helper")
startup_merb(:merb_root => File.join(File.dirname(__FILE__), "directory"))

describe "The default Merb directory structure" do

  it "should load in controllers" do
    calling { Base }.should_not raise_error
  end

  it "should be able to complete the dispatch cycle" do
    controller = dispatch_to(Base, :string)
    controller.body.should == "String"
  end

  it "should be able to complete the dispatch cycle with templates" do
    controller = dispatch_to(Base, :template)
    controller.body.should == "Template ERB"
  end

end

describe "Modifying the _template_path" do

  it "should move the templates to a new location" do
    controller = dispatch_to(Custom, :template)
    controller.body.should == "Wonderful Template"
  end

end

describe "Merb.root_path" do

  it "should return a path relative to Merb.root" do
    path = Merb.root_path('/app/controllers/base.rb')
    path.to_s.should == File.join(Merb.root, '/app/controllers/base.rb')
  end

  it "should accept multiple arguments like File.join" do
    path = Merb.root_path('app', 'controllers', 'base.rb')
    path.to_s.should == File.join(Merb.root, 'app', 'controllers', 'base.rb')
  end

end

Version data entries

12 entries across 6 versions & 1 rubygems

Version Path
merb-core-1.1.3 spec10/public/directory_structure/directory_spec.rb
merb-core-1.1.3 spec/public/directory_structure/directory_spec.rb
merb-core-1.1.2 spec/public/directory_structure/directory_spec.rb
merb-core-1.1.2 spec10/public/directory_structure/directory_spec.rb
merb-core-1.1.1 spec/public/directory_structure/directory_spec.rb
merb-core-1.1.1 spec10/public/directory_structure/directory_spec.rb
merb-core-1.1.0 spec/public/directory_structure/directory_spec.rb
merb-core-1.1.0 spec10/public/directory_structure/directory_spec.rb
merb-core-1.1.0.rc1 spec/public/directory_structure/directory_spec.rb
merb-core-1.1.0.rc1 spec10/public/directory_structure/directory_spec.rb
merb-core-1.1.0.pre spec/public/directory_structure/directory_spec.rb
merb-core-1.1.0.pre spec10/public/directory_structure/directory_spec.rb