मेरे पास एक मानक रेल 3.2 एप है जिसमें कुछ अजीब व्यवहार चल रहा है।स्पार्क मेरे रेल ऐप में अपरिभाषित विधि त्रुटि का कारण बनता है?
मैं बिना स्पार्क चलाने के rspec spec/
चला सकता हूं और सभी परीक्षणों में कोई समस्या नहीं होती है।
फिर मैं स्पार्क को आग लगाता हूं और फिर चश्मा चलाता हूं। इस बार, हर परीक्षण है कि मेरे मेलर्स को छूता है, एक ही त्रुटि के साथ विफल हो जाएगा:
Failures:
1) InvitationsController GET accept with non-matching token should redirect to the root path
Failure/Error: let!(:invitation) { Factory :invitation }
NoMethodError:
undefined method `invite' for InvitationMailer:Class
# ./app/models/invitation.rb:29:in `send_email'
# ./spec/controllers/invitations_controller_spec.rb:5:in `block (3 levels) in <top (required)>'
फिर, बस यह सब एक छोटे से weirder, मैं व्यक्तिगत निर्देशिका या चश्मा, के साथ या spork चल बिना चला सकते हैं बनाने के लिए, और सब कुछ कोई समस्या नहीं गुजरता है। उदाहरण rspec spec/mailers
या rspec spec/models
।
class InvitationMailer < ActionMailer::Base
default from: APP_CONFIG[:default_from]
def invite(invitation)
@invitation = invitation
mail(to: @invitation.recipient_email, subject: "the subject")
end
end
कोई भी विचार
क्या हो रहा हो सकता:
यहाँ विधि है जो मुझे बताया जा रहा है अपरिभाषित है?
@ डकफुज़, क्या आपको समाधान मिला? –
नहीं। मैं जल्द ही ऐप से स्पार्क लेने की योजना बना रहा हूं। जब यह काम करता है तो मुझे स्पार्क पसंद है लेकिन मुझे लगता है कि मैं इसे ज्यादातर समय पर भरोसा नहीं कर सकता। –
कारखाने और परीक्षण कोड के बिना इस प्रश्न का उत्तर देना मुश्किल है। – Wes