Commit 20ac104d8a2654774a475c90f95f09dce1a86e55
1 parent
0f1bc65a
Exists in
master
and in
23 other branches
ActionItem1111: in postgres, when search for blank there was a crash
* Adding .to_i before searching on database
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
app/models/approve_article.rb
| @@ -44,7 +44,7 @@ class ApproveArticle < Task | @@ -44,7 +44,7 @@ class ApproveArticle < Task | ||
| 44 | end | 44 | end |
| 45 | 45 | ||
| 46 | def article_parent | 46 | def article_parent |
| 47 | - Article.find_by_id article_parent_id | 47 | + Article.find_by_id article_parent_id.to_i |
| 48 | end | 48 | end |
| 49 | 49 | ||
| 50 | def article_parent= value | 50 | def article_parent= value |
test/functional/tasks_controller_test.rb
| @@ -191,4 +191,16 @@ class TasksControllerTest < Test::Unit::TestCase | @@ -191,4 +191,16 @@ class TasksControllerTest < Test::Unit::TestCase | ||
| 191 | assert_equal true, PublishedArticle.find(:first).highlighted | 191 | assert_equal true, PublishedArticle.find(:first).highlighted |
| 192 | end | 192 | end |
| 193 | 193 | ||
| 194 | + should 'create published article after choosing root folder on approve article task' do | ||
| 195 | + PublishedArticle.destroy_all | ||
| 196 | + c = Community.create!(:name => 'test comm', :moderated_articles => false) | ||
| 197 | + @controller.stubs(:profile).returns(c) | ||
| 198 | + c.affiliate(profile, Profile::Roles.all_roles(profile.environment.id)) | ||
| 199 | + article = profile.articles.create!(:name => 'something interesting', :body => 'ruby on rails') | ||
| 200 | + t = ApproveArticle.create!(:name => 'test name', :article => article, :target => c, :requestor => profile) | ||
| 201 | + | ||
| 202 | + post :close, :decision => 'finish', :id => t.id, :task => { :name => 'new_name', :article_parent_id => ""} | ||
| 203 | + assert_not_nil PublishedArticle.find(:first) | ||
| 204 | + end | ||
| 205 | + | ||
| 194 | end | 206 | end |