Skip to content

Commit

Permalink
Corrige cenários de teste informando novo parametro
Browse files Browse the repository at this point in the history
  • Loading branch information
AnaPerola committed Feb 22, 2024
1 parent dd13ac5 commit f29ba8f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/services/exam_poster/final_recovery_poster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
score_rounder = double(:score_rounder)

expect(ScoreRounder).to receive(:new)
.with(classroom, RoundedAvaliations::FINAL_RECOVERY)
.with(classroom, RoundedAvaliations::FINAL_RECOVERY, school_calendar.steps.last)
.and_return(score_rounder)
.at_least(:once)
expect(score_rounder).to receive(:round)
Expand Down
12 changes: 10 additions & 2 deletions spec/services/exam_poster/numerical_exam_poster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,20 @@
score_rounder = double(:score_rounder)

expect(ScoreRounder).to receive(:new)
.with(classroom, RoundedAvaliations::SCHOOL_TERM_RECOVERY)
.with(
classroom,
RoundedAvaliations::SCHOOL_TERM_RECOVERY,
classroom.calendar.classroom_steps.first
)
.and_return(score_rounder)
.at_least(:once)

expect(ScoreRounder).to receive(:new)
.with(classroom, RoundedAvaliations::NUMERICAL_EXAM)
.with(
classroom,
RoundedAvaliations::NUMERICAL_EXAM,
classroom.calendar.classroom_steps.first
)
.and_return(score_rounder)
.at_least(:once)

Expand Down
10 changes: 8 additions & 2 deletions spec/services/student_average_calculation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
let(:daily_note_students) { [daily_note_student_1, daily_note_student_2, daily_note_student_3] }
it 'expects to call score_rounder with correct params' do
expect(ScoreRounder).to receive(:new)
.with(classroom, RoundedAvaliations::NUMERICAL_EXAM)
.with(classroom, RoundedAvaliations::NUMERICAL_EXAM, school_calendar_step)
.and_return(score_rounder)
.at_least(:once)

Expand Down Expand Up @@ -309,7 +309,13 @@ def stub_recovery_diary_record_2
def stub_score_rounder
stub_const('ScoreRounder', Class.new)
allow(ScoreRounder).to(
receive(:new).with(classroom, RoundedAvaliations::NUMERICAL_EXAM).and_return(score_rounder)
receive(:new)
.with(
classroom,
RoundedAvaliations::NUMERICAL_EXAM,
school_calendar_step
)
.and_return(score_rounder)
)
end

Expand Down

0 comments on commit f29ba8f

Please sign in to comment.