From a88da16b6aaf6af563124d0ef5c46d8eaa308a5a Mon Sep 17 00:00:00 2001 From: Michael Sipayung Date: Fri, 26 Jan 2024 14:57:30 +0700 Subject: [PATCH] unit testing finished for pmdk --- .idea/sample_app.iml | 204 +++++++++--------- ...pmdk_each_score_informations_controller.rb | 24 +++ app/models/pmdk_each_score_information.rb | 6 + ...each_score_informations_controller_test.rb | 173 +++++++++++++-- .../fixtures/pmdk_each_score_informations.yml | 10 +- .../pmdk_each_score_information_test.rb | 180 +++++++++++++++- 6 files changed, 475 insertions(+), 122 deletions(-) diff --git a/.idea/sample_app.iml b/.idea/sample_app.iml index 43da09d..11cf93d 100644 --- a/.idea/sample_app.iml +++ b/.idea/sample_app.iml @@ -313,33 +313,33 @@ - - - + + + - + - + - + - + - + @@ -350,13 +350,13 @@ - - + + @@ -369,101 +369,99 @@ - - - - + + + - - + + - - - + + + + + + + - + - + + - + + - + - - + - - + - - - - - + - - - - + - - - - - - - - + + - - + + + + - + + + + + - - - - - - - - + + + - + - + + - - + - - - - + + - + + + + + + + + - + + - + + @@ -477,44 +475,56 @@ + + + - + - + - + + + + + + + + + + - + - - - + + + - - + + - + - + @@ -531,7 +541,6 @@ - @@ -542,15 +551,20 @@ + + + + + - - + + @@ -575,43 +589,27 @@ - + - - - - + + + + - + - - - - - - - - - - - - + - - - - - diff --git a/app/controllers/pmdk_each_score_informations_controller.rb b/app/controllers/pmdk_each_score_informations_controller.rb index f8fdc12..acb56d3 100644 --- a/app/controllers/pmdk_each_score_informations_controller.rb +++ b/app/controllers/pmdk_each_score_informations_controller.rb @@ -1,16 +1,40 @@ class PmdkEachScoreInformationsController < ApplicationController def new + @pmdk_each_score = current_user.build_pmdk_each_score_information end def update + @pmdk_each_score = current_user.pmdk_each_score_information + if @pmdk_each_score.update(pmdk_each_score_information_params) + flash[:success] = "Pmdk each score information is updated" + else + render 'edit' + end end def create + @pmdk_each_score = current_user.build_pmdk_each_score_information(pmdk_each_score_information_params) + if @pmdk_each_score.save + flash[:success] = "Pmdk each score information saved" + else + render 'new' + end end def edit + @pmdk_each_score = current_user.pmdk_each_score_information end def show end + private + def pmdk_each_score_information_params + params.require(:pmdk_each_score_information).permit( + :matematika_semester_1, :matematika_semester_2, :matematika_semester_3, :matematika_semester_4, + :matematika_semester_5, :kimia_semester_1, :kimia_semester_2, :kimia_semester_3, :kimia_semester_4, + :kimia_semester_5, :fisika_semester_1, :fisika_semester_2, :fisika_semester_3, :fisika_semester_4, + :fisika_semester_5, :bahasa_inggris_semester_1, :bahasa_inggris_semester_2, :bahasa_inggris_semester_3, + :bahasa_inggris_semester_4, :bahasa_inggris_semester_5 + ) + end end diff --git a/app/models/pmdk_each_score_information.rb b/app/models/pmdk_each_score_information.rb index ead7174..915701b 100644 --- a/app/models/pmdk_each_score_information.rb +++ b/app/models/pmdk_each_score_information.rb @@ -1,3 +1,9 @@ class PmdkEachScoreInformation < ApplicationRecord belongs_to :user + validates :matematika_semester_1, :matematika_semester_2, :matematika_semester_3, :matematika_semester_4, + :matematika_semester_5, :kimia_semester_1, :kimia_semester_2, :kimia_semester_3, :kimia_semester_4, + :kimia_semester_5, :fisika_semester_1, :fisika_semester_2, :fisika_semester_3, :fisika_semester_4, + :fisika_semester_5, :bahasa_inggris_semester_1, :bahasa_inggris_semester_2, :bahasa_inggris_semester_3, + :bahasa_inggris_semester_4, :bahasa_inggris_semester_5, presence: true, + numericality: {only_integer: false, greater_than_or_equal_to: 2, less_than_or_equal_to: 100} end diff --git a/test/controllers/pmdk_each_score_informations_controller_test.rb b/test/controllers/pmdk_each_score_informations_controller_test.rb index 961b1ba..2d69791 100644 --- a/test/controllers/pmdk_each_score_informations_controller_test.rb +++ b/test/controllers/pmdk_each_score_informations_controller_test.rb @@ -1,28 +1,177 @@ require "test_helper" class PmdkEachScoreInformationsControllerTest < ActionDispatch::IntegrationTest - test "should get new" do - get pmdk_each_score_informations_new_url + def setup + get login_path + post login_path, params: {session: { + email: users(:michael).email, password: 'password' + }} + end + test "should get new pmdk each score information" do + get new_pmdk_each_score_information_path assert_response :success end - - test "should get update" do - get pmdk_each_score_informations_update_url + test "should get edit pmdk each score information" do + get edit_pmdk_each_score_information_path(pmdk_each_score_informations(:pmdk_each_score_one)) assert_response :success end + test "should create new pmdk each score information" do + get new_pmdk_each_score_information_path + assert_response :success + assert_difference 'PmdkEachScoreInformation.count' do + post pmdk_each_score_informations_path, params: {pmdk_each_score_information: { + matematika_semester_1: 90, matematika_semester_2: 80, + matematika_semester_3: 89, matematika_semester_4: 90.8, + matematika_semester_5: 88.9, kimia_semester_1: 98.9, + kimia_semester_2: 98.3, kimia_semester_3: 88.7, + kimia_semester_4: 88.5,kimia_semester_5: 88.1, + fisika_semester_1: 34.9, fisika_semester_2: 99.9, + fisika_semester_3: 88.9, fisika_semester_4: 99.7, + fisika_semester_5: 67.7, bahasa_inggris_semester_1: 88.5, + bahasa_inggris_semester_2: 56.8, bahasa_inggris_semester_3: 77.2, + bahasa_inggris_semester_4: 88.1,bahasa_inggris_semester_5: 99.3 + }} + end + assert_not_nil PmdkEachScoreInformation.find_by_user_id users(:michael).id + assert_not_nil PmdkEachScoreInformation.find_by_fisika_semester_1 34.9 + assert_not_nil PmdkEachScoreInformation.find_by_fisika_semester_2 99.9 + assert_not_nil PmdkEachScoreInformation.find_by_fisika_semester_3 88.9 + assert_not_nil PmdkEachScoreInformation.find_by_fisika_semester_4 99.7 + assert_not_nil PmdkEachScoreInformation.find_by_fisika_semester_5 67.7 - test "should get create" do - get pmdk_each_score_informations_create_url + assert_not_nil PmdkEachScoreInformation.find_by_matematika_semester_1 90 + assert_not_nil PmdkEachScoreInformation.find_by_matematika_semester_2 80 + assert_not_nil PmdkEachScoreInformation.find_by_matematika_semester_3 89 + assert_not_nil PmdkEachScoreInformation.find_by_matematika_semester_4 90.8 + assert_not_nil PmdkEachScoreInformation.find_by_matematika_semester_5 88.9 + + assert_not_nil PmdkEachScoreInformation.find_by_kimia_semester_1 98.9 + assert_not_nil PmdkEachScoreInformation.find_by_kimia_semester_2 98.3 + assert_not_nil PmdkEachScoreInformation.find_by_kimia_semester_3 88.7 + assert_not_nil PmdkEachScoreInformation.find_by_kimia_semester_4 88.5 + assert_not_nil PmdkEachScoreInformation.find_by_kimia_semester_5 88.1 + + assert_not_nil PmdkEachScoreInformation.find_by_bahasa_inggris_semester_1 88.5 + assert_not_nil PmdkEachScoreInformation.find_by_bahasa_inggris_semester_2 56.8 + assert_not_nil PmdkEachScoreInformation.find_by_bahasa_inggris_semester_3 77.2 + assert_not_nil PmdkEachScoreInformation.find_by_bahasa_inggris_semester_4 88.1 + assert_not_nil PmdkEachScoreInformation.find_by_bahasa_inggris_semester_5 99.3 + end + test "should create new pmdk each score information but reject non-permited params" do + get new_pmdk_each_score_information_path assert_response :success + assert_difference 'PmdkEachScoreInformation.count' do + post pmdk_each_score_informations_path, params: {pmdk_each_score_information: { + matematika_semester_1: 90, matematika_semester_2: 80, + matematika_semester_3: 89, matematika_semester_4: 90.8, + matematika_semester_5: 88.9, kimia_semester_1: 98.9, + kimia_semester_2: 98.3, kimia_semester_3: 88.7, + kimia_semester_4: 88.5,kimia_semester_5: 88.1, + fisika_semester_1: 34.9, fisika_semester_2: 99.9, + fisika_semester_3: 88.9, fisika_semester_4: 99.7, + fisika_semester_5: 67.7, bahasa_inggris_semester_1: 88.5, + bahasa_inggris_semester_2: 56.8, bahasa_inggris_semester_3: 77.2, + bahasa_inggris_semester_4: 88.1,bahasa_inggris_semester_5: 99.3, user_id: 9888090 + }} + end + assert_nil PmdkEachScoreInformation.find_by_user_id 9888090 end - - test "should get edit" do - get pmdk_each_score_informations_edit_url + test "should reject to create new pmdk each score information for invalid data" do + get new_pmdk_each_score_information_path assert_response :success + assert_no_difference 'PmdkEachScoreInformation.count' do + post pmdk_each_score_informations_path, params: {pmdk_each_score_information: { + matematika_semester_1: 90.12, matematika_semester_2: 0, + matematika_semester_3: 89, matematika_semester_4: 90.8, + matematika_semester_5: 88.9, kimia_semester_1: 98.9, + kimia_semester_2: 98.3, kimia_semester_3: 88.7, + kimia_semester_4: 88.5,kimia_semester_5: 88.1, + fisika_semester_1: 34.9, fisika_semester_2: 99.9, + fisika_semester_3: 88.9, fisika_semester_4: 99.7, + fisika_semester_5: 67.7, bahasa_inggris_semester_1: 88.5, + bahasa_inggris_semester_2: 56.8, bahasa_inggris_semester_3: 77.2, + bahasa_inggris_semester_4: 88.1,bahasa_inggris_semester_5: 99.3 + }} + end + assert_nil PmdkEachScoreInformation.find_by_matematika_semester_1 90.12 end + test "should update each pmdk score information" do + get login_path + post login_path, params: {session: { + email: users(:archer).email, password: 'password' + }} + get edit_pmdk_each_score_information_path(pmdk_each_score_informations(:pmdk_each_score_one)) + assert_response :success + patch pmdk_each_score_information_path(pmdk_each_score_informations(:pmdk_each_score_one)), + params: {pmdk_each_score_information: { + matematika_semester_1: 90.12, matematika_semester_2: 17.8, + matematika_semester_3: 89, matematika_semester_4: 90.8, + matematika_semester_5: 88.9, kimia_semester_1: 98.9, + kimia_semester_2: 98.3, kimia_semester_3: 88.7, + kimia_semester_4: 88.5,kimia_semester_5: 88.1, + fisika_semester_1: 34.9, fisika_semester_2: 99.9, + fisika_semester_3: 88.9, fisika_semester_4: 99.7, + fisika_semester_5: 67.7, bahasa_inggris_semester_1: 88.5, + bahasa_inggris_semester_2: 56.8, bahasa_inggris_semester_3: 77.2, + bahasa_inggris_semester_4: 88.1,bahasa_inggris_semester_5: 99.3 + }} + pmdk_each_score_informations(:pmdk_each_score_one).reload + assert_equal 90.12, pmdk_each_score_informations(:pmdk_each_score_one).matematika_semester_1 + assert_equal 17.8, pmdk_each_score_informations(:pmdk_each_score_one).matematika_semester_2 + assert_equal 89, pmdk_each_score_informations(:pmdk_each_score_one).matematika_semester_3 + assert_equal 90.8, pmdk_each_score_informations(:pmdk_each_score_one).matematika_semester_4 + assert_equal 88.9, pmdk_each_score_informations(:pmdk_each_score_one).matematika_semester_5 - test "should get show" do - get pmdk_each_score_informations_show_url + assert_equal 99.3, pmdk_each_score_informations(:pmdk_each_score_one).bahasa_inggris_semester_5 + assert_equal 88.1, pmdk_each_score_informations(:pmdk_each_score_one).bahasa_inggris_semester_4 + assert_equal 77.2, pmdk_each_score_informations(:pmdk_each_score_one).bahasa_inggris_semester_3 + assert_equal 56.8, pmdk_each_score_informations(:pmdk_each_score_one).bahasa_inggris_semester_2 + assert_equal 88.5, pmdk_each_score_informations(:pmdk_each_score_one).bahasa_inggris_semester_1 + end + test "should reject to update each pmdk score for invalid data" do + get login_path + post login_path, params: {session: { + email: users(:archer).email, password: 'password' + }} + get edit_pmdk_each_score_information_path(pmdk_each_score_informations(:pmdk_each_score_one)) + assert_response :success + patch pmdk_each_score_information_path(pmdk_each_score_informations(:pmdk_each_score_one)), + params: {pmdk_each_score_information: { + matematika_semester_1: 90.12, matematika_semester_2: 17.8, + matematika_semester_3: 89, matematika_semester_4: 90.8, + matematika_semester_5: 88.9, kimia_semester_1: 98.9, + kimia_semester_2: 98.3, kimia_semester_3: 88.7, + kimia_semester_4: 88.5,kimia_semester_5: 88.1, + fisika_semester_1: 34.9, fisika_semester_2: 99.9, + fisika_semester_3: 88.9, fisika_semester_4: 99.7, + fisika_semester_5: 67.7, bahasa_inggris_semester_1: 88.5, + bahasa_inggris_semester_2: 56.8, bahasa_inggris_semester_3: 77.2, + bahasa_inggris_semester_4: 88.1,bahasa_inggris_semester_5: 0 + }} + pmdk_each_score_informations(:pmdk_each_score_one).reload + assert_not_equal 0, pmdk_each_score_informations(:pmdk_each_score_one).bahasa_inggris_semester_5 + end + test "should reject non-permited params during update each pmdk score" do + get login_path + post login_path, params: {session: { + email: users(:archer).email, password: 'password' + }} + get edit_pmdk_each_score_information_path(pmdk_each_score_informations(:pmdk_each_score_one)) assert_response :success + patch pmdk_each_score_information_path(pmdk_each_score_informations(:pmdk_each_score_one)), + params: {pmdk_each_score_information: { + matematika_semester_1: 90.12, matematika_semester_2: 17.8, + matematika_semester_3: 89, matematika_semester_4: 90.8, + matematika_semester_5: 88.9, kimia_semester_1: 98.9, + kimia_semester_2: 98.3, kimia_semester_3: 88.7, + kimia_semester_4: 88.5,kimia_semester_5: 88.1, + fisika_semester_1: 34.9, fisika_semester_2: 99.9, + fisika_semester_3: 88.9, fisika_semester_4: 99.7, + fisika_semester_5: 67.7, bahasa_inggris_semester_1: 88.5, + bahasa_inggris_semester_2: 56.8, bahasa_inggris_semester_3: 77.2, + bahasa_inggris_semester_4: 88.1,bahasa_inggris_semester_5: 89, user_id: 888999569 + }} + pmdk_each_score_informations(:pmdk_each_score_one).reload + assert_not_equal 888999569, pmdk_each_score_informations(:pmdk_each_score_one).user_id end end diff --git a/test/fixtures/pmdk_each_score_informations.yml b/test/fixtures/pmdk_each_score_informations.yml index de941cc..2c424a0 100644 --- a/test/fixtures/pmdk_each_score_informations.yml +++ b/test/fixtures/pmdk_each_score_informations.yml @@ -1,7 +1,9 @@ # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -#one: -# matematika_semester_1: MyString +pmdk_each_score_one: + user: archer + matematika_semester_1: MyString -#two: -# matematika_semester_1: MyString +pmdk_each_score_two: + user: iana + matematika_semester_1: MyString diff --git a/test/models/pmdk_each_score_information_test.rb b/test/models/pmdk_each_score_information_test.rb index 11b9e84..a22254f 100644 --- a/test/models/pmdk_each_score_information_test.rb +++ b/test/models/pmdk_each_score_information_test.rb @@ -1,7 +1,181 @@ require "test_helper" class PmdkEachScoreInformationTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + def setup + @pmdk_each_score = + PmdkEachScoreInformation.new(user_id: users(:michael).id, + matematika_semester_1: 90, matematika_semester_2: 80, + matematika_semester_3: 89, matematika_semester_4: 90.8, + matematika_semester_5: 88.9, kimia_semester_1: 98.9, + kimia_semester_2: 98.9, kimia_semester_3: 88.7, + kimia_semester_4: 88.5,kimia_semester_5: 88.1, + fisika_semester_1: 34.9, fisika_semester_2: 99.9, + fisika_semester_3: 88.9, fisika_semester_4: 99.7, + fisika_semester_5: 67.7, bahasa_inggris_semester_1: 88.5, + bahasa_inggris_semester_2: 56.8, bahasa_inggris_semester_3: 77.2, + bahasa_inggris_semester_4: 88.1,bahasa_inggris_semester_5: 99) + end + test "should be valid pmdk each score information" do + assert @pmdk_each_score.valid? + end + test "should reject invalid matematika_semester_1 score" do + @pmdk_each_score.matematika_semester_1 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_1 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_1 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid matematika_semester_2 score" do + @pmdk_each_score.matematika_semester_2 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_2 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_2 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid matematika_semester_3 score" do + @pmdk_each_score.matematika_semester_3 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_3 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_3 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid matematika_semester_4 score" do + @pmdk_each_score.matematika_semester_4 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_4 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_4 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid matematika_semester_5 score" do + @pmdk_each_score.matematika_semester_5 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_5 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.matematika_semester_5 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid fisika_semester_1 score" do + @pmdk_each_score.fisika_semester_1 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_1 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_1 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid fisika_semester_2 score" do + @pmdk_each_score.fisika_semester_2 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_2 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_2 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid fisika_semester_3 score" do + @pmdk_each_score.fisika_semester_3 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_3 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_3 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid fisika_semester_4 score" do + @pmdk_each_score.fisika_semester_4 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_4 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_4 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid fisika_semester_5 score" do + @pmdk_each_score.fisika_semester_5 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_5 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.fisika_semester_5 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid kimia_semester_1 score" do + @pmdk_each_score.kimia_semester_1 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_1 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_1 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid kimia_semester_2 score" do + @pmdk_each_score.kimia_semester_2 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_2 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_2 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid kimia_semester_3 score" do + @pmdk_each_score.kimia_semester_3 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_3 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_3 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid kimia_semester_4 score" do + @pmdk_each_score.kimia_semester_4 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_4 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_4 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid kimia_semester_5 score" do + @pmdk_each_score.kimia_semester_5 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_5 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.kimia_semester_5 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid bahasa_inggris_sem_1 score" do + @pmdk_each_score.bahasa_inggris_semester_1 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_1 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_1 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid bahasa_inggris_sem_2 score" do + @pmdk_each_score.bahasa_inggris_semester_2 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_2 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_2 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid bahasa_inggris_sem_3 score" do + @pmdk_each_score.bahasa_inggris_semester_3 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_3 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_3 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid bahasa_inggris_sem_4 score" do + @pmdk_each_score.bahasa_inggris_semester_4 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_4 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_4 =nil + assert_not @pmdk_each_score.valid? + end + test "should reject invalid bahasa_inggris_sem_5 score" do + @pmdk_each_score.bahasa_inggris_semester_5 =1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_5 =-1 + assert_not @pmdk_each_score.valid? + @pmdk_each_score.bahasa_inggris_semester_5 =nil + assert_not @pmdk_each_score.valid? + end end