Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
193 views

When testing a rails 7 controller everything works splendidly until I get a redirect and then execute a follow_redirect!. At this point the session mysteriously disappears and my tests can no longer ...
David Wolff's user avatar
0 votes
1 answer
55 views

No route matches {:action=>"/login", :controller=>"categories", :email=>"[email protected]", :password=>"fardeen"} This is happening. require '...
Fardeen's user avatar
  • 21
0 votes
0 answers
120 views

My project uses PostgreSQL for production and H2 database for tests. Some content is saved to database and afterwards it is retrieved, changed and saved again to new rows. In this method some of ...
bluebird's user avatar
2 votes
0 answers
382 views

I am using jUnit 5 and Mockito to test my POST API. Here is what my method definition looks like. public ResponseEntity<Object> fetch(@NotNull @ApiParam(value = "any" ,required=true) @...
Ananya Chaurasia's user avatar
3 votes
3 answers
7k views

I wrote a controller which combines actuator info. @RestController @Slf4j public class AppStatusRestController { private final HealthEndpoint healthEndpoint; private final InfoEndpoint ...
makozaki's user avatar
  • 4,436
0 votes
0 answers
105 views

I have referred various answers on StackOverflow but I still haven't been able to resolve this issue. I am sharing the code for my controllers_test.rb and along with that the screenshot. Every time I ...
Rishabh Malhotra's user avatar
0 votes
0 answers
29 views

I have a controller class with 2 service interfaces: one is a post method of external URL and the second is a local repository. In the controller test class, I just want to moq the interface1, not the ...
N.Abdolalizadeh's user avatar
2 votes
1 answer
141 views

The test method is always failing. After the Setup the method UpdateAsync should return 1 in the result but it remains always 0 which results in exception in the controller method. Can you tell what I ...
Abhishek Vyas's user avatar
0 votes
1 answer
163 views

While Testing Comments Controller, I get this error while creating a comment. Failures: 1) CommentsController Valid POST create creates a new comment Failure/Error: post :create, params: { ...
David Çonquerør's user avatar
6 votes
2 answers
3k views

I want to write controller tests that also test my annotations. What I've read so far is that RestAssured one of the ways to go. It works smoothly when I only have one controller test in place. ...
Kyroy's user avatar
  • 163
0 votes
0 answers
360 views

I'm using Rails 5.2 with rspec-rails 3.7 and rails-controller-testing gems. I have a controller that filters results on the index action (yeah, bad practice, legacy code, etc). The problem is I need ...
sbstnssndn's user avatar
0 votes
1 answer
49 views

I am trying to run basic controller test. My controller_spec.rb looks like: class Test < ActionController::Base def test_meth puts 'hello for test meth' head 200 end end describe ...
Jaleel Ahmed's user avatar
1 vote
1 answer
48 views

I'm writing functional / controller tests for a ZF3 application (driven by PHPUnit and zendframework/zend-test). Like this: public function testWhatEver() { $this->dispatch('/'); $this->...
automatix's user avatar
  • 15.2k