1
는 it
블록에서 왜이 RSpec은 spec을 기술하여 다른 방법으로 결과를 보여줄까요?
context "stripe customer" do
subject { @customer = Stripe::Customer.retrieve @subscription.stripe_customer_token }
it "show me email" do
p @customer.email
p user.email
@customer.email.should == user.email
end
#its(:email) { should == user.email }
its(:description) { should == user.email }
end
주어이 통과한다. 주석 처리 된 #its 부분은 전달되지 않습니다. 나는 두 개의 다른 물건을 얻는다.
expected: "[email protected]" got: "[email protected]" (using ==)
이것은 database_cleaner
보석 때문입니까? 어떤 방식 으로든 나는 factory/database_cleaner를 제대로 설정하지 못하고 있습니까?
블록에서 일치하지 않는 이유는 무엇입니까? 어떻게 다를 수 있습니까?