Commit 683cffed authored by Qingyu Zhao's avatar Qingyu Zhao

Fix spec issues per review comment

parent 73afd158
......@@ -55,23 +55,12 @@ describe Gitlab::ImportExport::ImportFailureService do
with_them do
context 'when retry succeeds' do
before do
response_values = [:raise, true]
allow(label).to receive(:save!).exactly(2).times do
value = response_values.shift
value == :raise ? raise(exception) : value
end
end
it 'retries 1 time' do
expect(label).to receive(:save!).and_raise(exception.new)
expect(label).to receive(:save!).and_return(true)
perform_retry
end
it 'retries and logs import failure once with correct params' do
expect(subject).to receive(:log_import_failure).with(relation_key, relation_index, instance_of(exception), 1)
expect(subject).to receive(:log_import_failure).with(relation_key, relation_index, instance_of(exception), 1).once
perform_retry
end
......
......@@ -22,7 +22,7 @@ describe ImportFailure do
allow(subject).to receive(:project).and_return(nil)
end
it { is_expected.to validate_presence_of(:project) }
it { is_expected.to validate_presence_of(:group) }
end
end
end
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