You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm just begun learning controller testing with RSpec and accidently wrote
expect(response).to be 200
in place of
expect(response).to be_success
Full unit:
require 'spec_helper'
describe UserController do
describe "GET 'show'" do
it "assigns the requested user to @user" do
user = create(:user)
get :show, id: user.id
expect(response).to be 200
expect(response).to render_template :show
expect(assigns :user).to eq user
end
end
end
Result is shown in image:
The text was updated successfully, but these errors were encountered:
This is due a bug in either rack (see rack/rack#419) or rails (see rails/rails#13921 and rails/rails#13982) that causes [response].flatten to recurse infinitely. Both have been fixed (although I'm not sure if the rails fix has been released) but if you upgrade to versions that have fixes the problem will go away. In the meantime, make expectations about attributes of the response rather than on the response itself.
Hello, I'm just begun learning controller testing with RSpec and accidently wrote
in place of
Full unit:
Result is shown in image:
The text was updated successfully, but these errors were encountered: