Upvote:3
According to the rules laid out in Appendix V:
Study
Visitors may carry out the following study:
(a) educational exchanges or visits with a UK state or independent school; or
(b) a maximum of 30 days study, provided that the main purpose of the visit is not to study
So you should be fine taking an IELTS exam, as long as visiting your husband is the main purpose of the trip.