Commit 5b2b32f3 authored by Albert Salim's avatar Albert Salim

Expect attributes in non-order dependent manner

Project issues association is not defined
with an order, so the order of issuables in
these tests may not be deterministic.
parent 2ba6fcec
...@@ -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