Skip to content

Commit

Permalink
Modification des tests unitaires liés à school_year
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicolas1 authored and JeSuisUnCaillou committed Jun 3, 2024
1 parent 8c3056b commit 374316d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions spec/factories/wages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
yearly_cap { 100 }
mefstat4 { 123 }
ministry { :menj }
school_year { :school_year }
end
end
3 changes: 1 addition & 2 deletions spec/models/classe_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
describe "associations" do
it { is_expected.to belong_to(:establishment).class_name("Establishment") }
it { is_expected.to belong_to(:mef).class_name("Mef") }
it { is_expected.to belong_to(:school_year).class_name("SchoolYear") }
it { is_expected.to have_many(:students).order(%w[last_name first_name]) }
end

describe "validations" do
it { is_expected.to validate_presence_of(:label) }
it { is_expected.to validate_presence_of(:start_year) }
it { is_expected.to validate_numericality_of(:start_year).only_integer }
end

describe ".current" do
Expand Down
2 changes: 1 addition & 1 deletion spec/models/concerns/pfmp_amount_calculator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
it_calculates "a limited amount", 2

context "when the classe is from another year" do
before { schooling.classe.update!(start_year: 2022) }
before { schooling.classe.school_year.update!(start_year: 2022) }

it_calculates "the original amount"
end
Expand Down
4 changes: 4 additions & 0 deletions spec/models/wage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
RSpec.describe Wage do
subject(:wage) { build(:wage) }

describe "validations" do
it { is_expected.to belong_to(:school_year).class_name("SchoolYear") }
end

describe "validations" do
it { is_expected.to validate_presence_of(:mefstat4) }
it { is_expected.to validate_presence_of(:ministry) }
Expand Down

0 comments on commit 374316d

Please sign in to comment.