Skip to content

Commit

Permalink
Add spec to ensure correct attendance bsv days (#355)
Browse files Browse the repository at this point in the history
* Add spec to ensure correct attendance bsv days

Refs: https://help.puzzle.ch/#ticket/zoom/8532
  • Loading branch information
TheWalkingLeek authored Nov 26, 2024
1 parent ae55a90 commit 3371937
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/controllers/event/attendances_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@
expect(assigns(:participants)).to match_array([@p5, @p6])
end

it 'loads correct bsv days for participation' do
course.update!(bsv_days: 10)
@p1.update!(bsv_days: 6)
@p2.update!(bsv_days: nil)
@p4.update!(bsv_days: 4)

get :index, params: { group_id: group.id, id: course.id }

expect(assigns(:leaders).find { _1.id == @p1.id }.bsv_days).to eq(6)
expect(assigns(:leaders).find { _1.id == @p2.id }.bsv_days).to be_nil
expect(assigns(:cooks).find { _1.id == @p4.id }.bsv_days).to eq(4)
end

end

context 'PATCH update' do
Expand Down

0 comments on commit 3371937

Please sign in to comment.