Nominal predictor to be used in regression

Exactly, although you always need to be careful extrapolating to things that are not originally in the model (i.e., test = [2] in this case).