Commit 66530638 authored by Francisco Javier López's avatar Francisco Javier López

Merge branch 'alberts-fix-flaky-import-csv-service-spec' into 'master'

Expect attributes in non-order dependent manner

See merge request gitlab-org/gitlab!66302
parents 3e4e84a9 5b2b32f3
...@@ -67,10 +67,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type| ...@@ -67,10 +67,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type|
it 'correctly sets the issuable attributes' do it 'correctly sets the issuable attributes' do
expect { subject }.to change { issuables.count }.by 4 expect { subject }.to change { issuables.count }.by 4
expect(issuables.reload.last).to have_attributes( expect(issuables.reload).to include(have_attributes({ title: 'Test Title', description: 'Test Description' }))
title: 'Test Title',
description: 'Test Description'
)
end end
it_behaves_like 'importer with email notification' it_behaves_like 'importer with email notification'
...@@ -89,10 +86,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type| ...@@ -89,10 +86,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type|
it 'correctly sets the issuable attributes' do it 'correctly sets the issuable attributes' do
expect { subject }.to change { issuables.count }.by 3 expect { subject }.to change { issuables.count }.by 3
expect(issuables.reload.last).to have_attributes( expect(issuables.reload).to include(have_attributes(title: 'Title with quote"', description: 'Description'))
title: 'Title with quote"',
description: 'Description'
)
end end
it_behaves_like 'importer with email notification' it_behaves_like 'importer with email notification'
...@@ -111,10 +105,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type| ...@@ -111,10 +105,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type|
it 'correctly sets the issuable attributes' do it 'correctly sets the issuable attributes' do
expect { subject }.to change { issuables.count }.by 2 expect { subject }.to change { issuables.count }.by 2
expect(issuables.reload.last).to have_attributes( expect(issuables.reload).to include(have_attributes(title: 'Hello', description: 'World'))
title: 'Hello',
description: 'World'
)
end end
it_behaves_like 'importer with email notification' it_behaves_like 'importer with email notification'
...@@ -133,10 +124,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type| ...@@ -133,10 +124,7 @@ RSpec.shared_examples 'issuable import csv service' do |issuable_type|
it 'correctly sets the issuable attributes' do it 'correctly sets the issuable attributes' do
expect { subject }.to change { issuables.count }.by 3 expect { subject }.to change { issuables.count }.by 3
expect(issuables.reload.last).to have_attributes( expect(issuables.reload).to include(have_attributes(title: 'Hello', description: 'World'))
title: 'Hello',
description: 'World'
)
end end
it_behaves_like 'importer with email notification' it_behaves_like 'importer with email notification'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment