Skip to content

Commit

Permalink
bug fixes for update usm school information
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSipayung committed Jan 26, 2024
1 parent 55fc99b commit 4a9c0de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions app/controllers/usm_school_informations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def update
if @usm_school.update(usm_school_information_params)
flash[:success] = "usm school information is updated"
else
puts @usm_school.errors.full_messages
render 'edit'
end
end
Expand All @@ -28,10 +29,10 @@ def edit
def show
end
private
def usm_school_information_params
params.require(:usm_school_information).permit(
:jurusan_sekolah, :asal_sekolah, :akreditas, :jumlah_nilai_un,
:jumlah_pelajaran_un, :jumlah_pelajaran_semester_5, :jumlah_nilai_semester_5
)
end
def usm_school_information_params
params.require(:usm_school_information).permit(
:jurusan_sekolah, :asal_sekolah, :akreditas, :jumlah_nilai_un,
:jumlah_pelajaran_un, :jumlah_pelajaran_semester_5, :jumlah_nilai_semester_5
)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def setup
jumlah_pelajaran_semester_5: 15, jumlah_nilai_semester_5: 799.9
}
}
assert_equal 'usm school information is updated', flash[:success]
usm_school_informations(:usm_one).reload
puts usm_school_informations(:usm_one).reload.jurusan_sekolah
assert_equal 'ipa MA', usm_school_informations(:usm_one).reload.jurusan_sekolah
assert_equal 'sma santo tomas 2', usm_school_informations(:usm_one).asal_sekolah
assert_equal 'terakreditasi', usm_school_informations(:usm_one).akreditas
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/usm_school_informations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ usm_one:
user: archer
asal_sekolah: MyString
akreditas: MyString
jumlah_pelajaran_un: 1
jumlah_pelajaran_un: 2
jumlah_nilai_un: 9.99
jurusan_sekolah: MyString
jumlah_pelajaran_semester_5: 1
Expand All @@ -14,7 +14,7 @@ usm_two:
user: iana
asal_sekolah: MyString
akreditas: MyString
jumlah_pelajaran_un: 1
jumlah_pelajaran_un: 2
jumlah_nilai_un: 9.99
jurusan_sekolah: MyString
jumlah_pelajaran_semester_5: 1
Expand Down

0 comments on commit 4a9c0de

Please sign in to comment.