Skip to content

Commit

Permalink
Assign proper sequence numbers to relation members in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Oct 26, 2023
1 parent 4f542ef commit ee3f045
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/controllers/api/relations_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_relations_for_node
second_relation = create(:relation_member, :member => node).relation
_super_relation = create(:relation_member, :member => second_relation).relation
# should combine multiple relation_member references into just one relation entry
create(:relation_member, :member => node, :relation => relation_with_node, :sequence_id => 2)
create(:relation_member, :member => node, :relation => relation_with_node)
# should not include deleted relations
deleted_relation = create(:relation, :deleted)
create(:relation_member, :member => node, :relation => deleted_relation)
Expand All @@ -122,7 +122,7 @@ def test_relations_for_way
second_relation = create(:relation_member, :member => way).relation
_super_relation = create(:relation_member, :member => second_relation).relation
# should combine multiple relation_member references into just one relation entry
create(:relation_member, :member => way, :relation => relation_with_way, :sequence_id => 2)
create(:relation_member, :member => way, :relation => relation_with_way)
# should not include deleted relations
deleted_relation = create(:relation, :deleted)
create(:relation_member, :member => way, :relation => deleted_relation)
Expand All @@ -142,7 +142,7 @@ def test_relations_for_relation
second_relation = create(:relation_member, :member => relation).relation
_super_relation = create(:relation_member, :member => second_relation).relation
# should combine multiple relation_member references into just one relation entry
create(:relation_member, :member => relation, :relation => relation_with_relation, :sequence_id => 2)
create(:relation_member, :member => relation, :relation => relation_with_relation)
# should not include deleted relations
deleted_relation = create(:relation, :deleted)
create(:relation_member, :member => relation, :relation => deleted_relation)
Expand Down
1 change: 1 addition & 0 deletions test/factories/old_relation_member.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FactoryBot.define do
factory :old_relation_member do
sequence(:sequence_id)
member_role { "" }

old_relation
Expand Down
1 change: 1 addition & 0 deletions test/factories/relation_member.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FactoryBot.define do
factory :relation_member do
sequence(:sequence_id)
member_role { "" }

relation
Expand Down

0 comments on commit ee3f045

Please sign in to comment.