summaryrefslogtreecommitdiffstats
path: root/test/functional/issue_relations_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:07:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:07:43 +0000
commitc178aded61c24b6037cd2dc403161427c8c0f836 (patch)
tree1129180b3c698442bde8e42cfe97af751f6ad0a0 /test/functional/issue_relations_controller_test.rb
parent85531070161564e6a99bdf518e17486482fa1bdb (diff)
downloadredmine-c178aded61c24b6037cd2dc403161427c8c0f836.tar.gz
redmine-c178aded61c24b6037cd2dc403161427c8c0f836.zip
Test cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10046 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issue_relations_controller_test.rb')
-rw-r--r--test/functional/issue_relations_controller_test.rb18
1 files changed, 1 insertions, 17 deletions
diff --git a/test/functional/issue_relations_controller_test.rb b/test/functional/issue_relations_controller_test.rb
index b629808bb..286fd4e39 100644
--- a/test/functional/issue_relations_controller_test.rb
+++ b/test/functional/issue_relations_controller_test.rb
@@ -16,11 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
-require 'issue_relations_controller'
-
-# Re-raise errors caught by the controller.
-class IssueRelationsController; def rescue_action(e) raise e end; end
-
class IssueRelationsControllerTest < ActionController::TestCase
fixtures :projects,
@@ -36,15 +31,12 @@ class IssueRelationsControllerTest < ActionController::TestCase
:trackers
def setup
- @controller = IssueRelationsController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
User.current = nil
+ @request.session[:user_id] = 3
end
def test_create
assert_difference 'IssueRelation.count' do
- @request.session[:user_id] = 3
post :create, :issue_id => 1,
:relation => {:issue_to_id => '2', :relation_type => 'relates', :delay => ''}
end
@@ -56,7 +48,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
def test_create_xhr
assert_difference 'IssueRelation.count' do
- @request.session[:user_id] = 3
xhr :post, :create, :issue_id => 3, :relation => {:issue_to_id => '1', :relation_type => 'relates', :delay => ''}
assert_response :success
assert_template 'create'
@@ -71,7 +62,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
def test_create_should_accept_id_with_hash
assert_difference 'IssueRelation.count' do
- @request.session[:user_id] = 3
post :create, :issue_id => 1,
:relation => {:issue_to_id => '#2', :relation_type => 'relates', :delay => ''}
end
@@ -81,7 +71,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
def test_create_should_strip_id
assert_difference 'IssueRelation.count' do
- @request.session[:user_id] = 3
post :create, :issue_id => 1,
:relation => {:issue_to_id => ' 2 ', :relation_type => 'relates', :delay => ''}
end
@@ -92,7 +81,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
def test_create_should_not_break_with_non_numerical_id
assert_no_difference 'IssueRelation.count' do
assert_nothing_raised do
- @request.session[:user_id] = 3
post :create, :issue_id => 1,
:relation => {:issue_to_id => 'foo', :relation_type => 'relates', :delay => ''}
end
@@ -104,7 +92,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
assert_nil Issue.visible(User.find(3)).find_by_id(4)
assert_no_difference 'IssueRelation.count' do
- @request.session[:user_id] = 3
post :create, :issue_id => 1,
:relation => {:issue_to_id => '4', :relation_type => 'relates', :delay => ''}
end
@@ -114,7 +101,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
def test_create_xhr_with_failure
assert_no_difference 'IssueRelation.count' do
- @request.session[:user_id] = 3
xhr :post, :create, :issue_id => 3, :relation => {:issue_to_id => '999', :relation_type => 'relates', :delay => ''}
assert_response :success
@@ -127,7 +113,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
def test_destroy
assert_difference 'IssueRelation.count', -1 do
- @request.session[:user_id] = 3
delete :destroy, :id => '2'
end
end
@@ -139,7 +124,6 @@ class IssueRelationsControllerTest < ActionController::TestCase
end
assert_difference 'IssueRelation.count', -1 do
- @request.session[:user_id] = 3
xhr :delete, :destroy, :id => '2'
assert_response :success