add engine link option

This commit is contained in:
2012-12-26 20:45:22 +01:00
parent 55efff20a8
commit bf83d33527
3 changed files with 67 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
require 'spec_helper'
describe Cmtool::Menu::EngineLink do
let(:options) { Hash.new }
let(:link){ Cmtool::Menu::EngineLink.new(Cmtool::Engine, options)}
subject{ link }
its(:title) { should == 'Cmtool' }
it 'Should change title when given as option' do
options[:title] = 'Engine Title'
link.title.should == 'Engine Title'
end
it "should change the path to internal path when given as symbol option" do
options[:path] = :faqs
link.path.should == '/cmtool/faqs'
end
it "should directly return a path specified as a string in the options" do
options[:path] = 'http://www.google.com/'
link.path.should == 'http://www.google.com/'
end
end