describe User do
it { should belong_to(:shop) }
it { should respond_to(:shop) }
it { should respond_to (:first_name)}
it { should respond_to (:last_name)}
it { should respond_to (:email)}
工作正常。但只要我補充一下:Rails&Shoulda Spec Matcher:validate_presence_of(:first_name)吹起來
it { should validate_presence_of (:first_name)}
it { should validate_presence_of (:last_name)}
它打破,特別是在這個回調方法:
def get_url
source = "http://www.randomsite.com/"+ first_name + "+" + last_name
end
的零的隱式轉換成字符串+
我如何解決這個問題?