मैं एक कार्रवाई में कोड निम्नलिखित है:रेंडर का परीक्षण कैसे करें: file => 'public/404.html' Rspec 2 में?
render :file => 'public/404.html' and return
यह ब्राउज़र में ठीक काम करता है। मैं इस परीक्षण करने के लिए निम्नलिखित rspec उदाहरण लिखा है:
it "renders 404" do
get :new
response.should render_template('public/404.html')
end
निम्न त्रुटि में इस उदाहरण परिणाम चल रहा है:
Failure/Error: response.should render_template('public/404.html')
Expected block to return true value.
मैं भी कोशिश की है response.should render_template(:file => 'public/404.html')
लेकिन वह भी एक त्रुटि में परिणाम है।
मुझे इसका परीक्षण कैसे करना चाहिए?
यह काम नहीं करता है: render_template (: file => "bogus फ़ाइल") गुजरता है। – therin
मेरे लिए आरएसपीसी 3.2, रेल 4.2 काम करता है – fny