diff options
author | Marius Peter <marius.peter@tutanota.com> | 2025-01-01 18:02:02 +0100 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2025-01-01 18:02:02 +0100 |
commit | 0f3c5a381924cb10abbe57c67c3f5a00e5b790a6 (patch) | |
tree | de11d090421f8c5bdd33b3e2dc26b2460476da16 /test/models/score_test.rb | |
parent | 46c534cfef50a05937ce3354de3cd7ccddf3ab69 (diff) |
Updated more tests.
Diffstat (limited to 'test/models/score_test.rb')
-rw-r--r-- | test/models/score_test.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/test/models/score_test.rb b/test/models/score_test.rb index a895158..ecf5558 100644 --- a/test/models/score_test.rb +++ b/test/models/score_test.rb @@ -11,31 +11,39 @@ class ScoreTest < ActiveSupport::TestCase test "should have associated tartiflette" do @score.tartiflette = nil - assert_not @score.valid?, "Score has no associated tartiflette." + assert_not @score.valid?, "Score should not be valid without an associated tartiflette." end test "should have associated scoring_criterium" do @score.scoring_criterium = nil - assert_not @score.valid?, "Score has no associated scoring_criterium." + assert_not @score.valid?, "Score should not be valid without an associated scoring criterium." end test "should have value" do @score.value = nil - assert_not @score.valid?, "Score has no value." + assert_not @score.valid?, "Score should not be valid without a value." end test "value should be between 1 and 5" do @score.value = 3 - assert @score.valid?, "Score value is invalid." + assert @score.valid?, "Score with a value of 3 should be valid." end test "value should be greater than or equal to 1" do @score.value = 0 - assert_not @score.valid?, "Score is less than 1." + assert_not @score.valid?, "Score should not be valid with a value less than 1." end test "value should be less than or equal to 5" do @score.value = 6 - assert_not @score.valid?, "Score is greater than 5." + assert_not @score.valid?, "Score should not be valid with a value greater than 5." end + + test "should have a session_id" do + @score.session_id = nil + assert_not @score.valid?, "Score should not be valid without a session_id." + assert_includes @score.errors[:session_id], "can't be blank" + end + + end |