Closed geekpgh closed 11 years ago
I already started on the tests for this one.
I'm gettig this error when I try to add the actions:
Any idea what could be happening here?
Which line and in which file do you get this error?
You won't see the error in the browser. It just manifests as the batch action not being created. If you put a breakpoint in the function:
[HttpPost] [ValidateAntiForgeryToken] public ActionResult AddAction(BatchAction action)
You'll see that it never gets into the if for modelState.IsValid on line 188. IsValid is false. If you crack open the ModelState object in the debugger, you see the error inside it.
I think it has to do with the fact that we're trying to create the batch action in the controller for batch. Even the action that's being passed as a parameter to the method is null. I'm wondering if we'll have to figure out a different way to add actions?
I'm not sure, this is similar to how BatchNotes are added and they seem to be working OK. But it does seem wrong to use BatchController to add BatchNotes.
@steveplatz fixed the code to allow adding batch actions. However we need some tests for this still. I'll hang onto this and add some tests.
@steveplatz I added some new tests for BatchActions, but they fail. I think we may need to change BatchAction to have a virtual Batch, similar to how you did it in BatchComment.
I think you may have already done this on your branch, so I did not make that change. All the tests I added pass except for those that involve the batch.
The tests are now passing. Closing.
Users will be performing various actions on a batch. The dates and any notes associated with these actions should be recorded.
Examples of actions: