Permalink
Browse files

Added tests for Canvas::Layout

  • Loading branch information...
jhbabon committed May 13, 2012
1 parent a78a716 commit 67ecd232b83326184efe567960f34a23ba97c765
Showing with 32 additions and 0 deletions.
  1. +32 −0 test/unit/canvas/layout_test.rb
@@ -0,0 +1,32 @@
+# -*- encoding: utf-8 -*-
+
+require 'test_helper'
+
+class LayoutTester < Canvas::Layout
+ title 'testing'
+end
+
+class EmptyTester < Canvas::Layout
+end
+
+class Canvas::LayoutTest < ActionView::TestCase
+ setup do
+ @layout = LayoutTester.new
+ @layout.view = view
+
+ @empty = EmptyTester.new
+ @empty.view = view
+ end
+
+ test "should add title to page title" do
+ expected = @layout.title
+
+ assert_equal expected, @layout.page_title
+ end
+
+ test "should add default title if there is no title for the layout" do
+ expected = I18n.t('application.defaults.title')
+
+ assert_equal expected, @empty.page_title
+ end
+end

0 comments on commit 67ecd23

Please sign in to comment.