From: Andy Allan Date: Thu, 1 Jun 2017 09:59:48 +0000 (+0100) Subject: Remove the api_fixtures helper X-Git-Tag: live~3403 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/5d0ea2879632a950405c40823503640cbec65e8f?ds=sidebyside Remove the api_fixtures helper This is no longer required, as the tests no longer use fixtures. --- diff --git a/test/controllers/browse_controller_test.rb b/test/controllers/browse_controller_test.rb index 7bd119885..abb1ccdfe 100644 --- a/test/controllers/browse_controller_test.rb +++ b/test/controllers/browse_controller_test.rb @@ -2,8 +2,6 @@ require "test_helper" require "browse_controller" class BrowseControllerTest < ActionController::TestCase - api_fixtures - ## # test all routes which lead to this controller def test_routes diff --git a/test/controllers/old_node_controller_test.rb b/test/controllers/old_node_controller_test.rb index 0fcc46310..e6276cc05 100644 --- a/test/controllers/old_node_controller_test.rb +++ b/test/controllers/old_node_controller_test.rb @@ -2,8 +2,6 @@ require "test_helper" require "old_node_controller" class OldNodeControllerTest < ActionController::TestCase - api_fixtures - # # TODO: test history # diff --git a/test/controllers/old_relation_controller_test.rb b/test/controllers/old_relation_controller_test.rb index f15acf849..36b35ec38 100644 --- a/test/controllers/old_relation_controller_test.rb +++ b/test/controllers/old_relation_controller_test.rb @@ -2,8 +2,6 @@ require "test_helper" require "old_relation_controller" class OldRelationControllerTest < ActionController::TestCase - api_fixtures - ## # test all routes which lead to this controller def test_routes diff --git a/test/controllers/old_way_controller_test.rb b/test/controllers/old_way_controller_test.rb index eae9d8a2e..dd971a677 100644 --- a/test/controllers/old_way_controller_test.rb +++ b/test/controllers/old_way_controller_test.rb @@ -2,8 +2,6 @@ require "test_helper" require "old_way_controller" class OldWayControllerTest < ActionController::TestCase - api_fixtures - ## # test all routes which lead to this controller def test_routes diff --git a/test/controllers/search_controller_test.rb b/test/controllers/search_controller_test.rb index 8c7a2d2b1..5b27666d9 100644 --- a/test/controllers/search_controller_test.rb +++ b/test/controllers/search_controller_test.rb @@ -1,8 +1,6 @@ require "test_helper" class SearchControllerTest < ActionController::TestCase - api_fixtures - ## # test all routes which lead to this controller def test_routes diff --git a/test/controllers/site_controller_test.rb b/test/controllers/site_controller_test.rb index 681df7945..26d936e1b 100644 --- a/test/controllers/site_controller_test.rb +++ b/test/controllers/site_controller_test.rb @@ -1,8 +1,6 @@ require "test_helper" class SiteControllerTest < ActionController::TestCase - api_fixtures - ## # setup oauth keys def setup diff --git a/test/controllers/swf_controller_test.rb b/test/controllers/swf_controller_test.rb index e293bc41b..953bf33ab 100644 --- a/test/controllers/swf_controller_test.rb +++ b/test/controllers/swf_controller_test.rb @@ -1,8 +1,6 @@ require "test_helper" class SwfControllerTest < ActionController::TestCase - api_fixtures - ## # test all routes which lead to this controller def test_routes diff --git a/test/models/friend_test.rb b/test/models/friend_test.rb index 08eeeeb17..b60b72ad1 100644 --- a/test/models/friend_test.rb +++ b/test/models/friend_test.rb @@ -1,10 +1,4 @@ require "test_helper" class FriendTest < ActiveSupport::TestCase - api_fixtures - - def test_friend_count - create(:friend) - assert_equal 1, Friend.count - end end diff --git a/test/models/message_test.rb b/test/models/message_test.rb index e2d87136e..84c466649 100644 --- a/test/models/message_test.rb +++ b/test/models/message_test.rb @@ -2,8 +2,6 @@ require "test_helper" class MessageTest < ActiveSupport::TestCase - api_fixtures - EURO = "\xe2\x82\xac".freeze # euro symbol def test_check_empty_message_fails diff --git a/test/models/node_tag_test.rb b/test/models/node_tag_test.rb index f1d8750a0..29eda2bff 100644 --- a/test/models/node_tag_test.rb +++ b/test/models/node_tag_test.rb @@ -1,8 +1,6 @@ require "test_helper" class NodeTagTest < ActiveSupport::TestCase - api_fixtures - def test_length_key_valid tag = create(:node_tag) (0..255).each do |i| diff --git a/test/models/node_test.rb b/test/models/node_test.rb index cf60c84ec..6c4717654 100644 --- a/test/models/node_test.rb +++ b/test/models/node_test.rb @@ -1,8 +1,6 @@ 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? diff --git a/test/models/oauth_nonce_test.rb b/test/models/oauth_nonce_test.rb index 341019cca..dd97278c1 100644 --- a/test/models/oauth_nonce_test.rb +++ b/test/models/oauth_nonce_test.rb @@ -1,8 +1,6 @@ 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. diff --git a/test/models/old_node_tag_test.rb b/test/models/old_node_tag_test.rb index f49be9256..3f0867a87 100644 --- a/test/models/old_node_tag_test.rb +++ b/test/models/old_node_tag_test.rb @@ -1,8 +1,6 @@ require "test_helper" class OldNodeTagTest < ActiveSupport::TestCase - api_fixtures - def test_length_key_valid tag = create(:old_node_tag) (0..255).each do |i| diff --git a/test/models/old_relation_tag_test.rb b/test/models/old_relation_tag_test.rb index 5c27ef3ea..58c70cc9c 100644 --- a/test/models/old_relation_tag_test.rb +++ b/test/models/old_relation_tag_test.rb @@ -1,8 +1,6 @@ require "test_helper" class OldRelationTagTest < ActiveSupport::TestCase - api_fixtures - def test_length_key_valid tag = create(:old_relation_tag) (0..255).each do |i| diff --git a/test/models/old_relation_test.rb b/test/models/old_relation_test.rb index 3858fd1ac..62f5e720b 100644 --- a/test/models/old_relation_test.rb +++ b/test/models/old_relation_test.rb @@ -1,8 +1,6 @@ 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) diff --git a/test/models/old_way_tag_test.rb b/test/models/old_way_tag_test.rb index 9a258ffb9..057bdf4f0 100644 --- a/test/models/old_way_tag_test.rb +++ b/test/models/old_way_tag_test.rb @@ -1,8 +1,6 @@ require "test_helper" class OldWayTagTest < ActiveSupport::TestCase - api_fixtures - def test_length_key_valid tag = create(:old_way_tag) (0..255).each do |i| diff --git a/test/models/old_way_test.rb b/test/models/old_way_test.rb index 16b5d3363..c8f4a4480 100644 --- a/test/models/old_way_test.rb +++ b/test/models/old_way_test.rb @@ -1,8 +1,6 @@ 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) diff --git a/test/models/relation_member_test.rb b/test/models/relation_member_test.rb index 2c03bc17e..170b1977c 100644 --- a/test/models/relation_member_test.rb +++ b/test/models/relation_member_test.rb @@ -1,9 +1,4 @@ require "test_helper" class RelationMemberTest < ActiveSupport::TestCase - api_fixtures - - def test_relation_member_count - assert_equal 9, RelationMember.count - end end diff --git a/test/models/relation_tag_test.rb b/test/models/relation_tag_test.rb index f221f78cc..3b4d2cdfc 100644 --- a/test/models/relation_tag_test.rb +++ b/test/models/relation_tag_test.rb @@ -1,8 +1,6 @@ require "test_helper" class RelationTagTest < ActiveSupport::TestCase - api_fixtures - def test_length_key_valid tag = create(:relation_tag) (0..255).each do |i| diff --git a/test/models/relation_test.rb b/test/models/relation_test.rb index cb0d54a9b..d422738bf 100644 --- a/test/models/relation_test.rb +++ b/test/models/relation_test.rb @@ -1,12 +1,6 @@ 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 = "" assert_nothing_raised(OSM::APIBadXMLError) do diff --git a/test/models/request_token_test.rb b/test/models/request_token_test.rb index 24ad419fa..7bfed5a56 100644 --- a/test/models/request_token_test.rb +++ b/test/models/request_token_test.rb @@ -1,8 +1,6 @@ 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? diff --git a/test/models/user_test.rb b/test/models/user_test.rb index a2a45e203..387c75ec9 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -4,9 +4,6 @@ require "test_helper" 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? diff --git a/test/models/way_node_test.rb b/test/models/way_node_test.rb index 1e4508c3f..04422da72 100644 --- a/test/models/way_node_test.rb +++ b/test/models/way_node_test.rb @@ -1,9 +1,4 @@ require "test_helper" class WayNodeTest < ActiveSupport::TestCase - api_fixtures - - def test_way_nodes_count - assert_equal 9, WayNode.count - end end diff --git a/test/models/way_tag_test.rb b/test/models/way_tag_test.rb index ae8be73b3..cde5bd415 100644 --- a/test/models/way_tag_test.rb +++ b/test/models/way_tag_test.rb @@ -1,8 +1,6 @@ require "test_helper" class WayTagTest < ActiveSupport::TestCase - api_fixtures - def test_length_key_valid tag = create(:way_tag) (0..255).each do |i| diff --git a/test/models/way_test.rb b/test/models/way_test.rb index ed8a6cea3..4519ebba8 100644 --- a/test/models/way_test.rb +++ b/test/models/way_test.rb @@ -1,14 +1,6 @@ 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) diff --git a/test/test_helper.rb b/test/test_helper.rb index dba005145..e475ab4c5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -11,43 +11,6 @@ module ActiveSupport 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