Sha256: 8492dd503d8ea5abeb1b1856a782def650f53d5aabf8a173ad6270237f125dfb

Contents?: true

Size: 1.04 KB

Versions: 17

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

class PageTest < Zena::Unit::TestCase

  context 'Creating a page' do
    setup do
      login(:tiger)
    end

    should 'work with just a title' do
      assert_difference('Node.count', 1) do
        secure(Page) { Page.create(:parent_id=>nodes_id(:projects), :title=>'lazy node')}
      end
    end

    should 'allow same title' do
      wiki_title = nodes(:wiki).title
      assert_difference('Node.count', 1) do
        page = secure(Page) { Page.create(:parent_id=>nodes_id(:projects), :title => wiki_title)}
        assert_equal page.title, wiki_title
      end
    end
  end # Creating a page

  def test_custom_base_path
    login(:tiger)
    node = secure!(Node) { nodes(:wiki) }
    bird = secure!(Node) { nodes(:bird_jpg)}
    assert_equal '', node.basepath
    assert_equal '', bird.basepath
    assert_equal node[:id], bird[:parent_id]
    assert node.update_attributes(:custom_base => true)
    assert_equal '18/29', node.basepath
    bird = secure!(Node) { nodes(:bird_jpg)}
    assert_equal '18/29', bird.basepath
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
zena-1.2.8 test/unit/page_test.rb
zena-1.2.7 test/unit/page_test.rb
zena-1.2.6 test/unit/page_test.rb
zena-1.2.5 test/unit/page_test.rb
zena-1.2.4 test/unit/page_test.rb
zena-1.2.3 test/unit/page_test.rb
zena-1.2.2 test/unit/page_test.rb
zena-1.2.1 test/unit/page_test.rb
zena-1.2.0 test/unit/page_test.rb
zena-1.1.3 test/unit/page_test.rb
zena-1.1.2 test/unit/page_test.rb
zena-1.1.1 test/unit/page_test.rb
zena-1.1.0 test/unit/page_test.rb
zena-1.0.0 test/unit/page_test.rb
zena-1.0.0.rc3 test/unit/page_test.rb
zena-1.0.0.rc2 test/unit/page_test.rb
zena-1.0.0.rc1 test/unit/page_test.rb