@@ -22,7 +22,9 require 'repositories_controller' | |||||
22 | class RepositoriesController; def rescue_action(e) raise e end; end |
|
22 | class RepositoriesController; def rescue_action(e) raise e end; end | |
23 |
|
23 | |||
24 | class RepositoriesControllerTest < ActionController::TestCase |
|
24 | class RepositoriesControllerTest < ActionController::TestCase | |
25 | fixtures :projects, :users, :roles, :members, :member_roles, :repositories, :issues, :issue_statuses, :changesets, :changes, :issue_categories, :enumerations, :custom_fields, :custom_values, :trackers |
|
25 | fixtures :projects, :users, :roles, :members, :member_roles, | |
|
26 | :repositories, :issues, :issue_statuses, :changesets, :changes, | |||
|
27 | :issue_categories, :enumerations, :custom_fields, :custom_values, :trackers | |||
26 |
|
28 | |||
27 | def setup |
|
29 | def setup | |
28 | @controller = RepositoriesController.new |
|
30 | @controller = RepositoriesController.new | |
@@ -72,7 +74,13 class RepositoriesControllerTest < ActionController::TestCase | |||||
72 | def test_committers |
|
74 | def test_committers | |
73 | @request.session[:user_id] = 2 |
|
75 | @request.session[:user_id] = 2 | |
74 | # add a commit with an unknown user |
|
76 | # add a commit with an unknown user | |
75 | Changeset.create!(:repository => Project.find(1).repository, :committer => 'foo', :committed_on => Time.now, :revision => 100, :comments => 'Committed by foo.') |
|
77 | Changeset.create!( | |
|
78 | :repository => Project.find(1).repository, | |||
|
79 | :committer => 'foo', | |||
|
80 | :committed_on => Time.now, | |||
|
81 | :revision => 100, | |||
|
82 | :comments => 'Committed by foo.' | |||
|
83 | ) | |||
76 |
|
84 | |||
77 | get :committers, :id => 1 |
|
85 | get :committers, :id => 1 | |
78 | assert_response :success |
|
86 | assert_response :success | |
@@ -94,8 +102,13 class RepositoriesControllerTest < ActionController::TestCase | |||||
94 | def test_map_committers |
|
102 | def test_map_committers | |
95 | @request.session[:user_id] = 2 |
|
103 | @request.session[:user_id] = 2 | |
96 | # add a commit with an unknown user |
|
104 | # add a commit with an unknown user | |
97 | c = Changeset.create!(:repository => Project.find(1).repository, :committer => 'foo', :committed_on => Time.now, :revision => 100, :comments => 'Committed by foo.') |
|
105 | c = Changeset.create!( | |
98 |
|
106 | :repository => Project.find(1).repository, | ||
|
107 | :committer => 'foo', | |||
|
108 | :committed_on => Time.now, | |||
|
109 | :revision => 100, | |||
|
110 | :comments => 'Committed by foo.' | |||
|
111 | ) | |||
99 | assert_no_difference "Changeset.count(:conditions => 'user_id = 3')" do |
|
112 | assert_no_difference "Changeset.count(:conditions => 'user_id = 3')" do | |
100 | post :committers, :id => 1, :committers => { '0' => ['foo', '2'], '1' => ['dlopper', '3']} |
|
113 | post :committers, :id => 1, :committers => { '0' => ['foo', '2'], '1' => ['dlopper', '3']} | |
101 | assert_redirected_to '/projects/ecookbook/repository/committers' |
|
114 | assert_redirected_to '/projects/ecookbook/repository/committers' |
General Comments 0
You need to be logged in to leave comments.
Login now