Commit 0498b3b88a46ddd7e39a20088bcbbd0650ec7e88
1 parent
7d4f8d39
Exists in
master
and in
23 other branches
Fix some tests after Solr port
Showing
3 changed files
with
4 additions
and
6 deletions
Show diff stats
lib/create_thumbnails_job.rb
| 1 | class CreateThumbnailsJob < Struct.new(:class_name, :file_id) | 1 | class CreateThumbnailsJob < Struct.new(:class_name, :file_id) |
| 2 | def perform | 2 | def perform |
| 3 | return unless class_name.constantize.exists?(file_id) | 3 | return unless class_name.constantize.exists?(file_id) |
| 4 | - Article.disable_ferret # acts_as_ferret sucks | ||
| 5 | file = class_name.constantize.find(file_id) | 4 | file = class_name.constantize.find(file_id) |
| 6 | file.create_thumbnails | 5 | file.create_thumbnails |
| 7 | - Article.enable_ferret # acts_as_ferret sucks | ||
| 8 | end | 6 | end |
| 9 | end | 7 | end |
test/unit/environment_finder_test.rb
| @@ -78,10 +78,10 @@ class EnvironmentFinderTest < ActiveSupport::TestCase | @@ -78,10 +78,10 @@ class EnvironmentFinderTest < ActiveSupport::TestCase | ||
| 78 | finder = EnvironmentFinder.new(Environment.default) | 78 | finder = EnvironmentFinder.new(Environment.default) |
| 79 | 79 | ||
| 80 | region = fast_create(Region, :name => 'r-test', :environment_id => Environment.default.id, :lat => 45.0, :lng => 45.0) | 80 | region = fast_create(Region, :name => 'r-test', :environment_id => Environment.default.id, :lat => 45.0, :lng => 45.0) |
| 81 | - ent1 = fast_create(Enterprise, :name => 'test 1', :identifier => 'test1', :lat => 45.0, :lng => 45.0) | 81 | + ent1 = fast_create(Enterprise, {:name => 'test 1', :identifier => 'test1', :lat => 45.0, :lng => 45.0}, :search => true) |
| 82 | p1 = create_user('test2').person | 82 | p1 = create_user('test2').person |
| 83 | p1.name = 'test 2'; p1.lat = 45.0; p1.lng = 45.0; p1.save! | 83 | p1.name = 'test 2'; p1.lat = 45.0; p1.lng = 45.0; p1.save! |
| 84 | - ent2 = fast_create(Enterprise, :name => 'test 3', :identifier => 'test3', :lat => 30.0, :lng => 30.0) | 84 | + ent2 = fast_create(Enterprise, {:name => 'test 3', :identifier => 'test3', :lat => 30.0, :lng => 30.0}, :search => true) |
| 85 | p2 = create_user('test4').person | 85 | p2 = create_user('test4').person |
| 86 | p2.name = 'test 4'; p2.lat = 30.0; p2.lng = 30.0; p2.save! | 86 | p2.name = 'test 4'; p2.lat = 30.0; p2.lng = 30.0; p2.save! |
| 87 | 87 |
test/unit/forum_helper_test.rb
| @@ -50,14 +50,14 @@ class ForumHelperTest < Test::Unit::TestCase | @@ -50,14 +50,14 @@ class ForumHelperTest < Test::Unit::TestCase | ||
| 50 | some_post.comments << Comment.new(:title => 'test', :body => 'test', :author => a2) | 50 | some_post.comments << Comment.new(:title => 'test', :body => 'test', :author => a2) |
| 51 | c = Comment.last | 51 | c = Comment.last |
| 52 | assert_equal 2, some_post.comments.count | 52 | assert_equal 2, some_post.comments.count |
| 53 | - assert_match /#{c.created_at.to_s} ago by <a href='[^']+'>a2<\/a>/, last_topic_update(some_post) | 53 | + assert_match(/#{Regexp.escape(c.created_at.to_s)} ago by <a href='[^']+'>a2<\/a>/, last_topic_update(some_post)) |
| 54 | end | 54 | end |
| 55 | 55 | ||
| 56 | should "return last comment author's name from unauthenticated user" do | 56 | should "return last comment author's name from unauthenticated user" do |
| 57 | some_post = TextileArticle.create!(:name => 'First post', :profile => profile, :parent => forum, :published => true) | 57 | some_post = TextileArticle.create!(:name => 'First post', :profile => profile, :parent => forum, :published => true) |
| 58 | some_post.comments << Comment.new(:name => 'John', :email => 'lenon@example.com', :title => 'test', :body => 'test') | 58 | some_post.comments << Comment.new(:name => 'John', :email => 'lenon@example.com', :title => 'test', :body => 'test') |
| 59 | c = Comment.last | 59 | c = Comment.last |
| 60 | - assert_match /#{c.created_at.to_s} ago by John/m, last_topic_update(some_post) | 60 | + assert_match(/#{Regexp.escape(c.created_at.to_s)} ago by John/m, last_topic_update(some_post)) |
| 61 | end | 61 | end |
| 62 | 62 | ||
| 63 | protected | 63 | protected |