Fixing the default selection of "allow web submits" - now with tests
Updated 1 year, 11 months ago
| Mike Conley | Reviewers | ||
| branches/release_0.6 | markus_developers | ||
| 580 | |||
| None | MarkUs Source Code Repository | ||
I've picked up where Severin left off here: http://review.markusproject.org/r/360/ . Strange that I couldn't just update his diff... *shrug*. Just wrote two small regression tests. It's nice to code again. :)
Manually tested to ensure that it works as advertised. All unit and functional tests are passing.
| branches/release_0.6/app/controllers/assignments_controller.rb | |||
|---|---|---|---|
| Revision 1196 | New Change | ||
| ... | 102 lines hidden [Expand] | ||
def new |
|||
| 103 |
@assignment = Assignment.new |
103 |
@assignment = Assignment.new |
| 104 |
@assignment.build_submission_rule |
104 |
@assignment.build_submission_rule |
| 105 |
|
105 |
|
| 106 |
if !request.post? |
106 |
if !request.post? |
| 107 |
# set default value if web submits are allowed
|
107 |
# set default value if web submits are allowed
|
| 108 | @assignment.allow_web_submits = markus_config_repository_external_submits_only? |
108 | @assignment.allow_web_submits = !MarkusConfigurator.markus_config_repository_external_submits_only? |
| 109 |
render :action => 'new' |
109 |
render :action => 'new' |
| 110 |
return
|
110 |
return
|
| 111 |
end |
111 |
end |
| 112 | 112 | ||
| 113 |
@assignment.transaction do |
113 |
@assignment.transaction do |
| ... | 287 lines hidden [Expand] | ||
| branches/release_0.6/test/functional/assignments_controller_test.rb | |
|---|---|
| Revision 1196 | New Change |

Other reviews