Commit 4fc900d2098b52c2d2c672e671e469e35104f070
1 parent
7fac67da
Exists in
master
and in
29 other branches
ActionItem21: adding test for attribution of "last changed by" on article updating
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@991 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
test/functional/cms_controller_test.rb
... | ... | @@ -91,7 +91,18 @@ class CmsControllerTest < Test::Unit::TestCase |
91 | 91 | end |
92 | 92 | |
93 | 93 | should 'set last_changed_by when updating article' do |
94 | - flunk 'pending' | |
94 | + other_person = create_user('otherperson').person | |
95 | + | |
96 | + a = profile.articles.build(:name => 'my article') | |
97 | + a.last_changed_by = other_person | |
98 | + a.save! | |
99 | + | |
100 | + login_as(profile.identifier) | |
101 | + post :edit, :profile => profile.identifier, :id => a.id, :article => { :body => 'new content for this article' } | |
102 | + | |
103 | + a.reload | |
104 | + | |
105 | + assert_equal profile, a.last_changed_by | |
95 | 106 | end |
96 | 107 | |
97 | 108 | should 'list available editors' do | ... | ... |