我正在关注 Michael Hartl 的精彩 Rails 教程,但我想知道是否有办法在我的用户规范中重构它。这是非常重复的,想知道是否有办法让它变干一点。
it { should respond_to(:name) }
it { should respond_to(:email) }
it { should respond_to(:password_digest) }
it { should respond_to(:password) }
it { should respond_to(:password_confirmation) }
it { should respond_to(:remember_token) }
it { should respond_to(:authenticate) }
it { should respond_to(:admin) }
it { should respond_to(:authenticate) }
it { should respond_to(:microposts) }
it { should respond_to(:feed) }
it { should respond_to(:relationships) }
it { should respond_to(:followed_users) }
it { should respond_to(:following?) }
it { should respond_to(:follow!) }
it { should respond_to(:followers) }
it { should respond_to(:reverse_relationships) }