https://svn.lrde.epita.fr/svn/ranch/trunk
Index: ChangeLog
from Nicolas Despr�s <nicolas.despres(a)gmail.com>
Update test case.
* web/ranch/test/functional/graph_form_controller_test.rb: Update the
test cases to fit to the view new name. Test the bad revision format
issue.
graph_form_controller_test.rb | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
Index: web/ranch/test/functional/graph_form_controller_test.rb
--- web/ranch/test/functional/graph_form_controller_test.rb (revision 42)
+++ web/ranch/test/functional/graph_form_controller_test.rb (working copy)
@@ -16,7 +16,7 @@
def test_index
get :index, { :bench_id => 1 }
assert_response :success
- assert_template 'index'
+ assert_template 'draw'
assert_not_nil assigns(:project)
assert_not_nil assigns(:bench)
@@ -31,10 +31,10 @@
def test_draw_regular_revision_range
post :draw, {
:bench_id => 1,
- :revision => { :start => 2, :stop => 8 }
+ :revision => { :range => "2-8" }
}
assert_response :success
- assert_template 'index'
+ assert_template 'draw'
assert_not_nil assigns(:project)
assert_not_nil assigns(:bench)
@@ -50,10 +50,10 @@
def test_draw_bad_revision_range
post :draw, {
:bench_id => 1,
- :revision => { :start => -42, :stop => 500 }
+ :revision => { :range => "-42-500" }
}
assert_response :success
- assert_template 'index'
+ assert_template 'draw'
assert_not_nil assigns(:project)
assert_not_nil assigns(:bench)
@@ -69,7 +69,7 @@
def test_draw_start_sup_stop
post :draw, {
:bench_id => 1,
- :revision => { :start => 42, :stop => 10 }
+ :revision => { :range => "42-10" }
}
assert_response :redirect
assert_redirected_to :action => 'index'
@@ -85,11 +85,11 @@
def test_draw_output_arg_num
post :draw, {
:bench_id => 1,
- :revision => { :start => 1, :stop => 10 },
+ :revision => { :range => "1-10" },
:output_arg_num => 0,
}
assert_response :success
- assert_template 'index'
+ assert_template 'draw'
assert_equal 1, assigns(:project).id
assert_equal 'determinize', assigns(:bench).name
@@ -99,4 +99,20 @@
assert_not_nil assigns(:input_set_num)
end
+ def test_draw_bad_revision_format
+ post :draw, {
+ :bench_id => 1,
+ :revision => { :range => "-42---10" }
+ }
+ assert_response :redirect
+ assert_redirected_to :action => 'index'
+
+ assert_equal 1, assigns(:project).id
+ assert_equal 'determinize', assigns(:bench).name
+ assert(flash.has_key?(:error))
+ assert_not_nil assigns(:output_arg_num)
+ assert_not_nil assigns(:inputs)
+ assert_not_nil assigns(:input_set_num)
+ end
+
end