Rewrite states_spec.rb