Skip to content

Commit

Permalink
Merge pull request #2348 from NationalSecurityAgency/t#2335/further-a…
Browse files Browse the repository at this point in the history
…ward-improvements

#2335 Add service test for badge validation
  • Loading branch information
sudo-may authored Jul 31, 2023
2 parents dc044c8 + 30548bc commit be5d2c1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions service/src/test/java/skills/intTests/AdminBadgesSpecs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -513,4 +513,22 @@ class AdminBadgesSpecs extends DefaultIntSpec {
updatedBadgeResult.awardAttrs.iconClass == "def"
updatedBadgeResult.awardAttrs.numMinutes == 600
}
def "can not exceed maximum minutes for badge"() {
def p1 = createProject(1)
def p1subj1 = createSubject(1, 1)
def p1Skills = createSkills(10, 1, 1, 100)
skillsService.createProjectAndSubjectAndSkills(p1, p1subj1, p1Skills)
def badge1 = SkillsFactory.createBadge(1, 1)
badge1.awardAttrs = [ name: 'Test Badge', iconClass: 'abc', numMinutes: 1000000]
when:
skillsService.createBadge(badge1)
then:
def ex = thrown(Exception)
ex.message.contains("numMinutes must be <= 525600")

}
}

0 comments on commit be5d2c1

Please sign in to comment.