Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit-MINT committed Jan 28, 2025
1 parent 4ce4465 commit 307b333
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/models/procedure_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,23 @@
end
end

describe '#update_labels_position' do
let(:procedure) { create(:procedure) }
let!(:labels) { create_list(:label, 5, procedure_id: procedure.id) }

it 'updates the positions of the specified instructeurs_procedures' do
procedure.update_labels_position(labels.map(&:id))

expect(procedure.labels.reload.pluck(:id, :position)).to match_array([
[labels[0].id, 0],
[labels[1].id, 1],
[labels[2].id, 2],
[labels[3].id, 3],
[labels[4].id, 4]
])
end
end

private

def create_dossier_with_pj_of_size(size, procedure)
Expand Down

0 comments on commit 307b333

Please sign in to comment.