]> git.openstreetmap.org Git - rails.git/commitdiff
Remove the api_fixtures helper
authorAndy Allan <git@gravitystorm.co.uk>
Thu, 1 Jun 2017 09:59:48 +0000 (10:59 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Thu, 1 Jun 2017 09:59:48 +0000 (10:59 +0100)
This is no longer required, as the tests no longer use fixtures.

26 files changed:
test/controllers/browse_controller_test.rb
test/controllers/old_node_controller_test.rb
test/controllers/old_relation_controller_test.rb
test/controllers/old_way_controller_test.rb
test/controllers/search_controller_test.rb
test/controllers/site_controller_test.rb
test/controllers/swf_controller_test.rb
test/models/friend_test.rb
test/models/message_test.rb
test/models/node_tag_test.rb
test/models/node_test.rb
test/models/oauth_nonce_test.rb
test/models/old_node_tag_test.rb
test/models/old_relation_tag_test.rb
test/models/old_relation_test.rb
test/models/old_way_tag_test.rb
test/models/old_way_test.rb
test/models/relation_member_test.rb
test/models/relation_tag_test.rb
test/models/relation_test.rb
test/models/request_token_test.rb
test/models/user_test.rb
test/models/way_node_test.rb
test/models/way_tag_test.rb
test/models/way_test.rb
test/test_helper.rb

index 7bd119885f04beb9c972a33ebe90803c09d1c412..abb1ccdfeaf5b1f7a7add3a4b0dc985a2d8b64f0 100644 (file)
@@ -2,8 +2,6 @@ require "test_helper"
 require "browse_controller"
 
 class BrowseControllerTest < ActionController::TestCase
 require "browse_controller"
 
 class BrowseControllerTest < ActionController::TestCase
-  api_fixtures
-
   ##
   # test all routes which lead to this controller
   def test_routes
   ##
   # test all routes which lead to this controller
   def test_routes
index 0fcc46310808b261bac2330373f2ea94818d2a14..e6276cc059c44892181ae9143aece2d818e8bd54 100644 (file)
@@ -2,8 +2,6 @@ require "test_helper"
 require "old_node_controller"
 
 class OldNodeControllerTest < ActionController::TestCase
 require "old_node_controller"
 
 class OldNodeControllerTest < ActionController::TestCase
-  api_fixtures
-
   #
   # TODO: test history
   #
   #
   # TODO: test history
   #
index f15acf8492807fe8ef407ed6b75ad8e3f9c96edb..36b35ec38504db62703b233f06fa060357df0660 100644 (file)
@@ -2,8 +2,6 @@ require "test_helper"
 require "old_relation_controller"
 
 class OldRelationControllerTest < ActionController::TestCase
 require "old_relation_controller"
 
 class OldRelationControllerTest < ActionController::TestCase
-  api_fixtures
-
   ##
   # test all routes which lead to this controller
   def test_routes
   ##
   # test all routes which lead to this controller
   def test_routes
index eae9d8a2eda1bea4fd8d71323728f64fff693d19..dd971a67784a47ff64733021d79ade97b190ec1d 100644 (file)
@@ -2,8 +2,6 @@ require "test_helper"
 require "old_way_controller"
 
 class OldWayControllerTest < ActionController::TestCase
 require "old_way_controller"
 
 class OldWayControllerTest < ActionController::TestCase
-  api_fixtures
-
   ##
   # test all routes which lead to this controller
   def test_routes
   ##
   # test all routes which lead to this controller
   def test_routes
index 8c7a2d2b1e1309369d510886f3ef47b3c126ed52..5b27666d9ffc5db4c7d95b65dd6681640cf914f6 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class SearchControllerTest < ActionController::TestCase
 require "test_helper"
 
 class SearchControllerTest < ActionController::TestCase
-  api_fixtures
-
   ##
   # test all routes which lead to this controller
   def test_routes
   ##
   # test all routes which lead to this controller
   def test_routes
index 681df794525bd5764822f48279e4f66296bb2034..26d936e1bf1fa860b23860b46a7e716e04176650 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class SiteControllerTest < ActionController::TestCase
 require "test_helper"
 
 class SiteControllerTest < ActionController::TestCase
-  api_fixtures
-
   ##
   # setup oauth keys
   def setup
   ##
   # setup oauth keys
   def setup
index e293bc41b2185b34dc7314d641eba65db1827647..953bf33ab0fd17b160236b82fe203f4a0b29d3de 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class SwfControllerTest < ActionController::TestCase
 require "test_helper"
 
 class SwfControllerTest < ActionController::TestCase
-  api_fixtures
-
   ##
   # test all routes which lead to this controller
   def test_routes
   ##
   # test all routes which lead to this controller
   def test_routes
index 08eeeeb17a3b3c7839245431a021469d1c7af962..b60b72ad18e6f0a3ccca2123e3d071ec742b2a33 100644 (file)
@@ -1,10 +1,4 @@
 require "test_helper"
 
 class FriendTest < ActiveSupport::TestCase
 require "test_helper"
 
 class FriendTest < ActiveSupport::TestCase
-  api_fixtures
-
-  def test_friend_count
-    create(:friend)
-    assert_equal 1, Friend.count
-  end
 end
 end
index e2d87136e7ee419478ab2a5c4eb4dbb0db7783b1..84c46664995e54374dc9ffec53f3ed128698a9d5 100644 (file)
@@ -2,8 +2,6 @@
 require "test_helper"
 
 class MessageTest < ActiveSupport::TestCase
 require "test_helper"
 
 class MessageTest < ActiveSupport::TestCase
-  api_fixtures
-
   EURO = "\xe2\x82\xac".freeze # euro symbol
 
   def test_check_empty_message_fails
   EURO = "\xe2\x82\xac".freeze # euro symbol
 
   def test_check_empty_message_fails
index f1d8750a0efa2cedd077ec000d122b9d426c7105..29eda2bffbd61a6217cd6854a128dca147d90573 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class NodeTagTest < ActiveSupport::TestCase
 require "test_helper"
 
 class NodeTagTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_length_key_valid
     tag = create(:node_tag)
     (0..255).each do |i|
   def test_length_key_valid
     tag = create(:node_tag)
     (0..255).each do |i|
index cf60c84ec96afa42ade1affc6d15cc6d5a08548c..6c4717654b05aa507c6ad2a8f53b3f53c2f01e12 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class NodeTest < ActiveSupport::TestCase
 require "test_helper"
 
 class NodeTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_node_too_far_north
     node = build(:node, :latitude => 90.01 * OldNode::SCALE)
     assert_equal false, node.valid?
   def test_node_too_far_north
     node = build(:node, :latitude => 90.01 * OldNode::SCALE)
     assert_equal false, node.valid?
index 341019cca0d31f038ca2d4ce7f8a05076eb55b03..dd97278c132415ad50040705191d90dd87685161 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class OauthNonceTest < ActiveSupport::TestCase
 require "test_helper"
 
 class OauthNonceTest < ActiveSupport::TestCase
-  api_fixtures
-
   ##
   # the nonce has only one property, that it is a unique pair of
   # string and timestamp.
   ##
   # the nonce has only one property, that it is a unique pair of
   # string and timestamp.
index f49be9256660d94a7dad0392ab101b459bab9f2d..3f0867a8772cd9813b8c84a07b193a2da1aff91b 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class OldNodeTagTest < ActiveSupport::TestCase
 require "test_helper"
 
 class OldNodeTagTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_length_key_valid
     tag = create(:old_node_tag)
     (0..255).each do |i|
   def test_length_key_valid
     tag = create(:old_node_tag)
     (0..255).each do |i|
index 5c27ef3ea57f63db34280dc52fa8585b546e81e8..58c70cc9c5fcba90aefe8b3316843a13c45452a0 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class OldRelationTagTest < ActiveSupport::TestCase
 require "test_helper"
 
 class OldRelationTagTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_length_key_valid
     tag = create(:old_relation_tag)
     (0..255).each do |i|
   def test_length_key_valid
     tag = create(:old_relation_tag)
     (0..255).each do |i|
index 3858fd1ac4b0a3a0672779156f57c76b0be1705f..62f5e720ba22383307dd1b8cbfa6e955cc6e1f0c 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class OldRelationTest < ActiveSupport::TestCase
 require "test_helper"
 
 class OldRelationTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_relation_tags
     old_relation_v1 = create(:old_relation, :version => 1)
     old_relation_v2 = create(:old_relation, :current_relation => old_relation_v1.current_relation, :version => 2)
   def test_relation_tags
     old_relation_v1 = create(:old_relation, :version => 1)
     old_relation_v2 = create(:old_relation, :current_relation => old_relation_v1.current_relation, :version => 2)
index 9a258ffb91f76fbab187dba69a71d2649b3025a0..057bdf4f0dca4650a9f71d4be10081aa477c3029 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class OldWayTagTest < ActiveSupport::TestCase
 require "test_helper"
 
 class OldWayTagTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_length_key_valid
     tag = create(:old_way_tag)
     (0..255).each do |i|
   def test_length_key_valid
     tag = create(:old_way_tag)
     (0..255).each do |i|
index 16b5d336336e2e1d5d108b1de24cc00e7d04403f..c8f4a4480b0a70f59f611f42da9bde6004976668 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class OldWayTest < ActiveSupport::TestCase
 require "test_helper"
 
 class OldWayTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_old_nodes
     old_way_v1 = create(:old_way, :version => 1)
     old_way_v2 = create(:old_way, :current_way => old_way_v1.current_way, :version => 2)
   def test_old_nodes
     old_way_v1 = create(:old_way, :version => 1)
     old_way_v2 = create(:old_way, :current_way => old_way_v1.current_way, :version => 2)
index 2c03bc17ed71288eebe02d2fb6ff1826faad68bb..170b1977c423445aadc8eba97644848b30b9059d 100644 (file)
@@ -1,9 +1,4 @@
 require "test_helper"
 
 class RelationMemberTest < ActiveSupport::TestCase
 require "test_helper"
 
 class RelationMemberTest < ActiveSupport::TestCase
-  api_fixtures
-
-  def test_relation_member_count
-    assert_equal 9, RelationMember.count
-  end
 end
 end
index f221f78cc9fac44c112b82f03f904e8503104e17..3b4d2cdfcbcd5e0fc400a7ff74c745ae56c03db5 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class RelationTagTest < ActiveSupport::TestCase
 require "test_helper"
 
 class RelationTagTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_length_key_valid
     tag = create(:relation_tag)
     (0..255).each do |i|
   def test_length_key_valid
     tag = create(:relation_tag)
     (0..255).each do |i|
index cb0d54a9b99c0bb1bfa66d0bcdfdd62401fecab3..d422738bf0853b12098fb5aacc2a5025ae914bca 100644 (file)
@@ -1,12 +1,6 @@
 require "test_helper"
 
 class RelationTest < ActiveSupport::TestCase
 require "test_helper"
 
 class RelationTest < ActiveSupport::TestCase
-  api_fixtures
-
-  def test_relation_count
-    assert_equal 8, Relation.count
-  end
-
   def test_from_xml_no_id
     noid = "<osm><relation version='12' changeset='23' /></osm>"
     assert_nothing_raised(OSM::APIBadXMLError) do
   def test_from_xml_no_id
     noid = "<osm><relation version='12' changeset='23' /></osm>"
     assert_nothing_raised(OSM::APIBadXMLError) do
index 24ad419fa814353dbe0ed3f59d491e75fcc2075a..7bfed5a56287d551c98b373c08b8921a459f4ed5 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class RequestTokenTest < ActiveSupport::TestCase
 require "test_helper"
 
 class RequestTokenTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_oob
     assert_equal true, RequestToken.new.oob?
     assert_equal true, RequestToken.new(:callback_url => "oob").oob?
   def test_oob
     assert_equal true, RequestToken.new.oob?
     assert_equal true, RequestToken.new(:callback_url => "oob").oob?
index a2a45e203d51a139abea01ec3f03b7d7d2b9d0ff..387c75ec9ebd2e3953f0ae01fa8a9389c824f72e 100644 (file)
@@ -4,9 +4,6 @@ require "test_helper"
 class UserTest < ActiveSupport::TestCase
   include Rails::Dom::Testing::Assertions::SelectorAssertions
 
 class UserTest < ActiveSupport::TestCase
   include Rails::Dom::Testing::Assertions::SelectorAssertions
 
-  api_fixtures
-  fixtures :user_roles
-
   def test_invalid_with_empty_attributes
     user = User.new
     assert !user.valid?
   def test_invalid_with_empty_attributes
     user = User.new
     assert !user.valid?
index 1e4508c3f24f7243cb046fac5ad2f9243bf91b45..04422da72696f82d31063eee5a1cc04970c54e28 100644 (file)
@@ -1,9 +1,4 @@
 require "test_helper"
 
 class WayNodeTest < ActiveSupport::TestCase
 require "test_helper"
 
 class WayNodeTest < ActiveSupport::TestCase
-  api_fixtures
-
-  def test_way_nodes_count
-    assert_equal 9, WayNode.count
-  end
 end
 end
index ae8be73b3f5183587e3e036b7e47f99546a5aac6..cde5bd4158d283ddee959c2024133a6fbf01c221 100644 (file)
@@ -1,8 +1,6 @@
 require "test_helper"
 
 class WayTagTest < ActiveSupport::TestCase
 require "test_helper"
 
 class WayTagTest < ActiveSupport::TestCase
-  api_fixtures
-
   def test_length_key_valid
     tag = create(:way_tag)
     (0..255).each do |i|
   def test_length_key_valid
     tag = create(:way_tag)
     (0..255).each do |i|
index ed8a6cea3e794981d23272fe5da060a646f0539c..4519ebba896a0142355e0898e3aa0cf68fd4d850 100644 (file)
@@ -1,14 +1,6 @@
 require "test_helper"
 
 class WayTest < ActiveSupport::TestCase
 require "test_helper"
 
 class WayTest < ActiveSupport::TestCase
-  api_fixtures
-
-  # Check that we have the correct number of currnet ways in the db
-  # This will need to updated whenever the current_ways.yml is updated
-  def test_db_count
-    assert_equal 7, Way.count
-  end
-
   def test_bbox
     node = create(:node)
     visible_way = create(:way)
   def test_bbox
     node = create(:node)
     visible_way = create(:way)
index dba005145483604835b45f477f22388604dee6b7..e475ab4c5656eac8a5742d484dfc50f537e995da 100644 (file)
@@ -11,43 +11,6 @@ module ActiveSupport
   class TestCase
     include FactoryGirl::Syntax::Methods
 
   class TestCase
     include FactoryGirl::Syntax::Methods
 
-    # Load standard fixtures needed to test API methods
-    def self.api_fixtures
-      # print "setting up the api_fixtures"
-      fixtures :users, :user_roles
-      fixtures :changesets
-
-      fixtures :current_nodes, :nodes
-      set_fixture_class :current_nodes => Node
-      set_fixture_class :nodes => OldNode
-
-      fixtures :current_ways
-      set_fixture_class :current_ways => Way
-
-      fixtures :current_way_nodes
-      set_fixture_class :current_way_nodes => WayNode
-
-      fixtures :ways
-      set_fixture_class :ways => OldWay
-
-      fixtures :way_nodes
-      set_fixture_class :way_nodes => OldWayNode
-
-      fixtures :current_relations
-      set_fixture_class :current_relations => Relation
-
-      fixtures :current_relation_members
-      set_fixture_class :current_relation_members => RelationMember
-
-      fixtures :relations
-      set_fixture_class :relations => OldRelation
-
-      fixtures :relation_members
-      set_fixture_class :relation_members => OldRelationMember
-
-      fixtures :redactions
-    end
-
     ##
     # takes a block which is executed in the context of a different
     # ActionController instance. this is used so that code can call methods
     ##
     # takes a block which is executed in the context of a different
     # ActionController instance. this is used so that code can call methods