Commit 5995bbecf36b1d5abfd8f16ae1efaf14604444f8

Authored by AntonioTerceiro
1 parent d14e126f

ActionItem21: testing the (actual) creation of a new article



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@988 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/my_profile/cms_controller.rb
... ... @@ -43,6 +43,7 @@ class CmsController < MyProfileController
43 43 if request.post?
44 44 if @article.save
45 45 redirect_to :action => 'view', :id => @article.id
  46 + return
46 47 end
47 48 end
48 49  
... ...
test/functional/cms_controller_test.rb
... ... @@ -61,7 +61,9 @@ class CmsControllerTest < Test::Unit::TestCase
61 61 end
62 62  
63 63 should 'be able to save a save a document' do
64   - flunk 'pending'
  64 + assert_difference Article, :count do
  65 + post :new, :profile => profile.identifier, :article => { :name => 'a test article', :body => 'the text of the article ...' }
  66 + end
65 67 end
66 68  
67 69 should 'be able to set home page' do
... ...