Commit 5995bbecf36b1d5abfd8f16ae1efaf14604444f8
1 parent
d14e126f
Exists in
master
and in
29 other branches
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
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
@@ -43,6 +43,7 @@ class CmsController < MyProfileController | @@ -43,6 +43,7 @@ class CmsController < MyProfileController | ||
43 | if request.post? | 43 | if request.post? |
44 | if @article.save | 44 | if @article.save |
45 | redirect_to :action => 'view', :id => @article.id | 45 | redirect_to :action => 'view', :id => @article.id |
46 | + return | ||
46 | end | 47 | end |
47 | end | 48 | end |
48 | 49 |
test/functional/cms_controller_test.rb
@@ -61,7 +61,9 @@ class CmsControllerTest < Test::Unit::TestCase | @@ -61,7 +61,9 @@ class CmsControllerTest < Test::Unit::TestCase | ||
61 | end | 61 | end |
62 | 62 | ||
63 | should 'be able to save a save a document' do | 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 | end | 67 | end |
66 | 68 | ||
67 | should 'be able to set home page' do | 69 | should 'be able to set home page' do |