diff options
Diffstat (limited to 'spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb b/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb index 30f8280fda3..eb6b07ce02f 100644 --- a/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb +++ b/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::JSON::StreamingSerializer do +RSpec.describe Gitlab::ImportExport::JSON::StreamingSerializer do let_it_be(:user) { create(:user) } let_it_be(:release) { create(:release) } let_it_be(:group) { create(:group) } @@ -61,6 +61,20 @@ describe Gitlab::ImportExport::JSON::StreamingSerializer do subject.execute end + + context 'relation ordering' do + before do + create_list(:issue, 5, project: exportable) + end + + it 'orders exported issues by primary key' do + expected_issues = exportable.issues.reorder(:id).map(&:to_json) + + expect(json_writer).to receive(:write_relation_array).with(exportable_path, :issues, expected_issues) + + subject.execute + end + end end context 'with single relation' do |