Commit 4ade473383856e409c4c2e9c79cc613262311db5
1 parent
5995bbec
Exists in
master
and in
29 other branches
ActionItem21: test for setting home page
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@989 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
12 additions
and
2 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
test/functional/cms_controller_test.rb
... | ... | @@ -67,7 +67,17 @@ class CmsControllerTest < Test::Unit::TestCase |
67 | 67 | end |
68 | 68 | |
69 | 69 | should 'be able to set home page' do |
70 | - flunk 'pending' | |
70 | + a = profile.articles.build(:name => 'my new home page') | |
71 | + a.save! | |
72 | + | |
73 | + assert_not_equal a, profile.home_page | |
74 | + | |
75 | + post :set_home_page, :profile => profile.identifier, :id => a.id | |
76 | + | |
77 | + assert_redirected_to :action => 'view', :id => a.id | |
78 | + | |
79 | + profile.reload | |
80 | + assert_equal a, profile.home_page | |
71 | 81 | end |
72 | 82 | |
73 | 83 | should 'set last_changed_by when creating article' do | ... | ... |