Commit 8ecff858dd5a8744be5ea219008f16120c60ba1b

Authored by Antonio Terceiro
1 parent 01c15571

Copying slug when copying an article

(ActionItem1451)
app/models/article.rb
@@ -278,7 +278,6 @@ class Article < ActiveRecord::Base @@ -278,7 +278,6 @@ class Article < ActiveRecord::Base
278 :id, 278 :id,
279 :profile_id, 279 :profile_id,
280 :parent_id, 280 :parent_id,
281 - :slug,  
282 :path, 281 :path,
283 :updated_at, 282 :updated_at,
284 :created_at, 283 :created_at,
test/unit/article_test.rb
@@ -571,6 +571,12 @@ class ArticleTest < Test::Unit::TestCase @@ -571,6 +571,12 @@ class ArticleTest < Test::Unit::TestCase
571 assert_kind_of Folder, b 571 assert_kind_of Folder, b
572 end 572 end
573 573
  574 + should 'copy slug' do
  575 + a = fast_create(Article, :slug => 'slug123')
  576 + b = a.copy({})
  577 + assert_equal a.slug, b.slug
  578 + end
  579 +
574 should 'load article under an old path' do 580 should 'load article under an old path' do
575 p = create_user('test_user').person 581 p = create_user('test_user').person
576 a = p.articles.create(:name => 'old-name') 582 a = p.articles.create(:name => 'old-name')