diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index 0018c7e..ebd95ea 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -24,6 +24,7 @@ class CmsController < MyProfileController @article.last_changed_by = user if @article.update_attributes(params[:article]) redirect_to :action => 'view', :id => @article.id + return end end diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index dd81e2c..70a1c05 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -91,7 +91,18 @@ class CmsControllerTest < Test::Unit::TestCase end should 'set last_changed_by when updating article' do - flunk 'pending' + other_person = create_user('otherperson').person + + a = profile.articles.build(:name => 'my article') + a.last_changed_by = other_person + a.save! + + login_as(profile.identifier) + post :edit, :profile => profile.identifier, :id => a.id, :article => { :body => 'new content for this article' } + + a.reload + + assert_equal profile, a.last_changed_by end should 'list available editors' do -- libgit2 0.21.2