Commit 489573d80b717ca03f9452b4014fdeac6ce6d706

Authored by Carlos Morais
Committed by Paulo Meireles
1 parent 7685aad1

Adding tests for hotspots: view_path, content_type

Showing 1 changed file with 26 additions and 0 deletions   Show diff stats
test/functional/cms_controller_test.rb
... ... @@ -1509,4 +1509,30 @@ class CmsControllerTest < ActionController::TestCase
1509 1509 assert_includes @controller.available_article_types, RawHTMLArticle
1510 1510 end
1511 1511  
  1512 + should 'include new contents special types from plugins' do
  1513 + types = [Integer, Float]
  1514 + plugins = mock()
  1515 + plugins.stubs(:map).with(:content_types).returns(types)
  1516 + plugins.stubs(:map).with(:body_beginning).returns([])
  1517 + plugins.stubs(:enabled_plugins).returns([])
  1518 + Noosfero::Plugin::Manager.expects(:new).returns(plugins)
  1519 +
  1520 + get :index, :profile => profile.identifier
  1521 +
  1522 + assert_includes @controller.special_article_types, Integer
  1523 + assert_includes @controller.special_article_types, Float
  1524 + end
  1525 +
  1526 + should 'include plugins view paths on partial search' do
  1527 + view_path = '/example/view_path'
  1528 + plugins = mock()
  1529 + plugins.stubs(:map).with(:view_path).returns(view_path)
  1530 + plugins.stubs(:enabled_plugins).returns([])
  1531 + Noosfero::Plugin::Manager.expects(:new).returns(plugins)
  1532 +
  1533 + get :new, :profile => profile.identifier
  1534 +
  1535 + assert_equal view_path, @controller.view_paths[0]
  1536 + end
  1537 +
1512 1538 end
... ...