refactored spec for checking value of input field