diff --git a/app/models/article.rb b/app/models/article.rb index 5b6c6b5..27325d3 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -114,6 +114,7 @@ class Article < ActiveRecord::Base ids.uniq.each do |item| add_category(Category.find(item)) unless item.to_i.zero? end + self.categories(true) end after_create :create_pending_categorizations diff --git a/test/functional/enterprise_registration_controller_test.rb b/test/functional/enterprise_registration_controller_test.rb index fc875e4..669f724 100644 --- a/test/functional/enterprise_registration_controller_test.rb +++ b/test/functional/enterprise_registration_controller_test.rb @@ -52,7 +52,7 @@ all_fixtures env = Environment.default env.organization_approval_method = :none env.save - region = fast_create(Region) + region = fast_create(Region, {}, :search => true) data = { :name => 'My new enterprise', :identifier => 'mynew', :region => region } create_enterprise = CreateEnterprise.new(data) diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb index 11b62e0..3a574ba 100644 --- a/test/unit/article_test.rb +++ b/test/unit/article_test.rb @@ -1562,10 +1562,10 @@ class ArticleTest < ActiveSupport::TestCase end should 'survive to a invalid src attribute while looking for images in body' do - domain = Environment.default.domains.first.name + domain = Environment.default.domains.first || Domain.new(:name => 'localhost') article = Article.new(:body => "An article with invalid src in img tag ", :profile => @profile) assert_nothing_raised URI::InvalidURIError do - assert_equal ["http://#{domain}/path%20with%20spaces.png"], article.body_images_paths + assert_equal ["http://#{domain.name}/path%20with%20spaces.png"], article.body_images_paths end end -- libgit2 0.21.2