remove trailing white-spaces from test/functional/issue_statuses_controller_test.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6932 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e103d11178
commit
32c2cf80e3
|
@ -7,7 +7,7 @@ class IssueStatusesController; def rescue_action(e) raise e end; end
|
||||||
|
|
||||||
class IssueStatusesControllerTest < ActionController::TestCase
|
class IssueStatusesControllerTest < ActionController::TestCase
|
||||||
fixtures :issue_statuses, :issues
|
fixtures :issue_statuses, :issues
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@controller = IssueStatusesController.new
|
@controller = IssueStatusesController.new
|
||||||
@request = ActionController::TestRequest.new
|
@request = ActionController::TestRequest.new
|
||||||
|
@ -15,19 +15,19 @@ class IssueStatusesControllerTest < ActionController::TestCase
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@request.session[:user_id] = 1 # admin
|
@request.session[:user_id] = 1 # admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_index
|
def test_index
|
||||||
get :index
|
get :index
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'index'
|
assert_template 'index'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_new
|
def test_new
|
||||||
get :new
|
get :new
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'new'
|
assert_template 'new'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_create
|
def test_create
|
||||||
assert_difference 'IssueStatus.count' do
|
assert_difference 'IssueStatus.count' do
|
||||||
post :create, :issue_status => {:name => 'New status'}
|
post :create, :issue_status => {:name => 'New status'}
|
||||||
|
@ -36,33 +36,33 @@ class IssueStatusesControllerTest < ActionController::TestCase
|
||||||
status = IssueStatus.find(:first, :order => 'id DESC')
|
status = IssueStatus.find(:first, :order => 'id DESC')
|
||||||
assert_equal 'New status', status.name
|
assert_equal 'New status', status.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_edit
|
def test_edit
|
||||||
get :edit, :id => '3'
|
get :edit, :id => '3'
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'edit'
|
assert_template 'edit'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_update
|
def test_update
|
||||||
post :update, :id => '3', :issue_status => {:name => 'Renamed status'}
|
post :update, :id => '3', :issue_status => {:name => 'Renamed status'}
|
||||||
assert_redirected_to :action => 'index'
|
assert_redirected_to :action => 'index'
|
||||||
status = IssueStatus.find(3)
|
status = IssueStatus.find(3)
|
||||||
assert_equal 'Renamed status', status.name
|
assert_equal 'Renamed status', status.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_destroy
|
def test_destroy
|
||||||
Issue.delete_all("status_id = 1")
|
Issue.delete_all("status_id = 1")
|
||||||
|
|
||||||
assert_difference 'IssueStatus.count', -1 do
|
assert_difference 'IssueStatus.count', -1 do
|
||||||
post :destroy, :id => '1'
|
post :destroy, :id => '1'
|
||||||
end
|
end
|
||||||
assert_redirected_to :action => 'index'
|
assert_redirected_to :action => 'index'
|
||||||
assert_nil IssueStatus.find_by_id(1)
|
assert_nil IssueStatus.find_by_id(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_destroy_should_block_if_status_in_use
|
def test_destroy_should_block_if_status_in_use
|
||||||
assert_not_nil Issue.find_by_status_id(1)
|
assert_not_nil Issue.find_by_status_id(1)
|
||||||
|
|
||||||
assert_no_difference 'IssueStatus.count' do
|
assert_no_difference 'IssueStatus.count' do
|
||||||
post :destroy, :id => '1'
|
post :destroy, :id => '1'
|
||||||
end
|
end
|
||||||
|
@ -91,5 +91,5 @@ class IssueStatusesControllerTest < ActionController::TestCase
|
||||||
should_redirect_to('the index') { '/issue_statuses' }
|
should_redirect_to('the index') { '/issue_statuses' }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue