X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f0bcdae908c67dae7a74ac75be391be446dbdaae..e3054fc15ac0fcc124700e80f44c1b9a180472d8:/test/controllers/reports_controller_test.rb diff --git a/test/controllers/reports_controller_test.rb b/test/controllers/reports_controller_test.rb index 9c39350f9..206958ab8 100644 --- a/test/controllers/reports_controller_test.rb +++ b/test/controllers/reports_controller_test.rb @@ -20,10 +20,12 @@ class ReportsControllerTest < ActionController::TestCase assert_response :success assert_difference "Issue.count", 1 do details = "Details of a report" + category = "other" post :create, :params => { :report => { :details => details, + :category => category, :issue => { :reportable_id => target_user.id, :reportable_type => "User" } } } @@ -47,10 +49,12 @@ class ReportsControllerTest < ActionController::TestCase assert_response :success assert_difference "Issue.count", 1 do details = "Details of a report" + category = "other" post :create, :params => { :report => { :details => details, + :category => category, :issue => { :reportable_id => target_user.id, :reportable_type => "User" } } } @@ -62,25 +66,13 @@ class ReportsControllerTest < ActionController::TestCase get :new, :params => { :reportable_id => target_user.id, :reportable_type => "User" } assert_response :success - # Report without report_type - assert_no_difference "Issue.count" do - details = "Details of another report under the same issue" - post :create, - :params => { - :report => { - :details => details, - :issue => { :reportable_id => target_user.id, :reportable_type => "User" } - } - } - end - assert_response :redirect - assert_equal 1, Issue.find_by(:reportable_id => target_user.id, :reportable_type => "User").reports.count - # Report without details assert_no_difference "Issue.count" do + category = "other" post :create, :params => { :report => { + :category => category, :issue => { :reportable_id => 1, :reportable_type => "User" } } } @@ -103,10 +95,12 @@ class ReportsControllerTest < ActionController::TestCase assert_response :success assert_difference "Issue.count", 1 do details = "Details of a report" + category = "other" post :create, :params => { :report => { :details => details, + :category => category, :issue => { :reportable_id => target_user.id, :reportable_type => "User" } } } @@ -120,10 +114,12 @@ class ReportsControllerTest < ActionController::TestCase assert_response :success assert_no_difference "Issue.count" do details = "Details of another report under the same issue" + category = "other" post :create, :params => { :report => { :details => details, + :category => category, :issue => { :reportable_id => target_user.id, :reportable_type => "User" } } }