Files
cmtool/spec/cmtool_menu/engine_link_spec.rb
T
2012-12-26 20:45:22 +01:00

25 lines
683 B
Ruby

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