Skip to content

Commit

Permalink
fixing the specs reveals errors in the code... deprecated_add working…
Browse files Browse the repository at this point in the history
… properly again for tabs
  • Loading branch information
saturnflyer committed Dec 20, 2009
1 parent 00b469d commit 729f0cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/radiant/admin_ui.rb
Expand Up @@ -27,7 +27,7 @@ def [](id)

def <<(*args)
options = args.extract_options!
item = args.size > 1 ? deprecated_add(*(args[1,2] << caller)) : args.first
item = args.size > 1 ? deprecated_add(*(args << caller)) : args.first
raise DuplicateTabNameError.new("duplicate tab name `#{item.name}'") if self[item.name]
item.tab = self if item.respond_to?(:tab=)
if options.empty?
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/radiant/admin_ui/nav_tabs_spec.rb
Expand Up @@ -67,9 +67,9 @@

it "should warn about using the deprecated add method" do
ActiveSupport::Deprecation.should_receive(:warn)
@tab.add(:pages, "Pages", "/admin/pages")
@tab[:pages].name.should == "Pages"
@tab[:pages].url.should == "/admin/pages"
@tab.add("Pages", "/admin/pages")
@tab['Pages'].name.should == "Pages"
@tab['Pages'].url.should == "/admin/pages"
end
end

Expand Down

0 comments on commit 729f0cd

Please sign in to comment.