Skip to content

Commit

Permalink
Upgrade tests for Rails 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Viney committed Jun 3, 2009
1 parent cdcd667 commit f5e04ae
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
@@ -1,3 +1,11 @@
[3 Jun 09]

* Upgrade tests for Rails 2.3

[18 Mar 09]

* Change callbacks used to save tags.

[18 Feb 09]

* Greatly improve speed when using find_tagged_with and :match_all [notonthehighstreet.com].
Expand Down
11 changes: 7 additions & 4 deletions test/abstract_unit.rb
Expand Up @@ -14,7 +14,8 @@
fixture_path = File.dirname(__FILE__) + '/fixtures/'
ActiveSupport::Dependencies.load_paths.insert(0, fixture_path)

require 'active_record/fixtures'
require "active_record/test_case"
require "active_record/fixtures"

require File.dirname(__FILE__) + '/../lib/acts_as_taggable'
require_dependency File.dirname(__FILE__) + '/../lib/tag_list'
Expand All @@ -26,9 +27,11 @@

load(File.dirname(__FILE__) + '/schema.rb')

Test::Unit::TestCase.fixture_path = fixture_path

class Test::Unit::TestCase #:nodoc:
class ActiveSupport::TestCase #:nodoc:
include ActiveRecord::TestFixtures

self.fixture_path = File.dirname(__FILE__) + "/fixtures/"

self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false

Expand Down
8 changes: 4 additions & 4 deletions test/acts_as_taggable_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/abstract_unit'

class ActsAsTaggableOnSteroidsTest < Test::Unit::TestCase
class ActsAsTaggableOnSteroidsTest < ActiveSupport::TestCase
fixtures :tags, :taggings, :posts, :users, :photos, :subscriptions, :magazines

def test_find_related_tags_with
Expand Down Expand Up @@ -204,8 +204,8 @@ def test_reassign_tag_list
assert_equivalent ["Nature", "Question"], posts(:jonathan_rain).tag_list
posts(:jonathan_rain).taggings.reload

# Only an update of the posts table should be executed
assert_queries 1 do
# Only an update of the posts table should be executed, the other two queries are for savepoints
assert_queries 3 do
posts(:jonathan_rain).update_attributes!(:tag_list => posts(:jonathan_rain).tag_list.to_s)
end

Expand Down Expand Up @@ -375,7 +375,7 @@ def test_tag_destroyed_when_unused
end
end

class ActsAsTaggableOnSteroidsFormTest < Test::Unit::TestCase
class ActsAsTaggableOnSteroidsFormTest < ActiveSupport::TestCase
fixtures :tags, :taggings, :posts, :users, :photos

include ActionView::Helpers::FormHelper
Expand Down
2 changes: 1 addition & 1 deletion test/tag_list_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/abstract_unit'

class TagListTest < Test::Unit::TestCase
class TagListTest < ActiveSupport::TestCase
def test_from_leaves_string_unchanged
tags = '"One ", Two'
original = tags.dup
Expand Down
2 changes: 1 addition & 1 deletion test/tag_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/abstract_unit'

class TagTest < Test::Unit::TestCase
class TagTest < ActiveSupport::TestCase
fixtures :tags, :taggings, :users, :photos, :posts

def test_name_required
Expand Down
2 changes: 1 addition & 1 deletion test/tagging_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/abstract_unit'

class TaggingTest < Test::Unit::TestCase
class TaggingTest < ActiveSupport::TestCase
fixtures :tags, :taggings, :posts

def test_tag
Expand Down
2 changes: 1 addition & 1 deletion test/tags_helper_test.rb
@@ -1,6 +1,6 @@
require File.dirname(__FILE__) + '/abstract_unit'

class TagsHelperTest < Test::Unit::TestCase
class TagsHelperTest < ActiveSupport::TestCase
fixtures :tags, :taggings, :posts

include TagsHelper
Expand Down

0 comments on commit f5e04ae

Please sign in to comment.