-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid deprecated TestResponse#success? method #2014
Conversation
Great, we're just working on fixing our ci (#2013), and then I'd like this rebased off a working build to check it's all green and I'll merge it. |
CI is now green. Do you think you can rebase a re-push? I can look at this, this afternoon. |
Closes rspec#2009 TestResponse#success? was deprecated with [this commit](rails/rails@af3500b). Instead, we can use #successful? from Rack::Response::Helpers. This method has been available for a long time. I tried this change with Rails 3.2, 4.2, and 5.2 and everything seemed to work fine.
98d9e55
to
436b9d0
Compare
|
Thanks a lot @composerinteralia |
See rspec/rspec-rails#2014 for details, fixes errors like Failure/Error: expect(response).to be_success expected #<ActionDispatch::TestResponse:0x0000560db29e9880 @mon_mutex=#<Thread::Mutex:0x0000560db29e9808>, @mo...ders:0x0000560db2cdf170 @Req=#<ActionController::TestRequest:0x0000560db29ea370 ...>>, @variant=[]>> to respond to `success?` # ./spec/controllers/people_controller_spec.rb:37:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:13:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:12:in `block (2 levels) in <main>'
See rspec/rspec-rails#2014 for details, fixes errors like Failure/Error: expect(response).to be_success expected #<ActionDispatch::TestResponse:0x0000560db29e9880 @mon_mutex=#<Thread::Mutex:0x0000560db29e9808>, @mo...ders:0x0000560db2cdf170 @Req=#<ActionController::TestRequest:0x0000560db29ea370 ...>>, @variant=[]>> to respond to `success?` # ./spec/controllers/people_controller_spec.rb:37:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:13:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:12:in `block (2 levels) in <main>'
See rspec/rspec-rails#2014 for details, fixes errors like Failure/Error: expect(response).to be_success expected #<ActionDispatch::TestResponse:0x0000560db29e9880 @mon_mutex=#<Thread::Mutex:0x0000560db29e9808>, @mo...ders:0x0000560db2cdf170 @Req=#<ActionController::TestRequest:0x0000560db29ea370 ...>>, @variant=[]>> to respond to `success?` # ./spec/controllers/people_controller_spec.rb:37:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:13:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:12:in `block (2 levels) in <main>'
See rspec/rspec-rails#2014 for details, fixes errors like Failure/Error: expect(response).to be_success expected #<ActionDispatch::TestResponse:0x0000560db29e9880 @mon_mutex=#<Thread::Mutex:0x0000560db29e9808>, @mo...ders:0x0000560db2cdf170 @Req=#<ActionController::TestRequest:0x0000560db29ea370 ...>>, @variant=[]>> to respond to `success?` # ./spec/controllers/people_controller_spec.rb:37:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:13:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:12:in `block (2 levels) in <main>'
See rspec/rspec-rails#2014 for details, fixes errors like Failure/Error: expect(response).to be_success expected #<ActionDispatch::TestResponse:0x0000560db29e9880 @mon_mutex=#<Thread::Mutex:0x0000560db29e9808>, @mo...ders:0x0000560db2cdf170 @Req=#<ActionController::TestRequest:0x0000560db29ea370 ...>>, @variant=[]>> to respond to `success?` # ./spec/controllers/people_controller_spec.rb:37:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:13:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:12:in `block (2 levels) in <main>'
See rspec/rspec-rails#2014 for details, fixes errors like Failure/Error: expect(response).to be_success expected #<ActionDispatch::TestResponse:0x0000560db29e9880 @mon_mutex=#<Thread::Mutex:0x0000560db29e9808>, @mo...ders:0x0000560db2cdf170 @Req=#<ActionController::TestRequest:0x0000560db29ea370 ...>>, @variant=[]>> to respond to `success?` # ./spec/controllers/people_controller_spec.rb:37:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:13:in `block (3 levels) in <main>' # ./spec/support/database_cleaner.rb:12:in `block (2 levels) in <main>'
Closes #2009
TestResponse#success?
was deprecated with this commit. Instead, we can use#successful?
fromRack::Response::Helpers
. This method has been available for a long time. I tried this change with Rails 3.2, 4.2, and 5.2 and everything seemed to work fine.