geekpgh / mastersproject

The masters project for SWENG 500 team 3
4 stars 2 forks source link

Add actions to a batch #24

Closed geekpgh closed 11 years ago

geekpgh commented 11 years ago

Users will be performing various actions on a batch. The dates and any notes associated with these actions should be recorded.

Examples of actions:

geekpgh commented 11 years ago

I already started on the tests for this one.

geekpgh commented 11 years ago

I'm gettig this error when I try to add the actions:

Any idea what could be happening here?

steveplatz commented 11 years ago

Which line and in which file do you get this error?

geekpgh commented 11 years ago

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.

steveplatz commented 11 years ago

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?

geekpgh commented 11 years ago

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.

geekpgh commented 11 years ago

@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.

geekpgh commented 11 years ago

@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.

geekpgh commented 11 years ago

The tests are now passing. Closing.