ruby on rails - Rspec rendering text -


i have code

if @temp_user.save   sign_in(:user, @temp_user)   render text: "ok" else   render text: render_to_string(:partial => "errors") end 

and try verify rspec render "ok"

this actual spec:

  "render text ok"        post :create, {:agent => valid_attributes}     # response.should have_content("ok")     response.should render_template(:text => "ok")   end 

but spec respond 0 failures always, when put "oki" in place "ok"

anyone have 1 suggestion that?

if using rails 3 or above

expect(response.body).to eq "ok" 

will work


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -