Mercurial > hg > soundsoftware-site
comparison test/functional/issues_controller_test.rb @ 931:ec1c49528f36 cannam_integration
Merge from branch "redmine-1.3"
author | Chris Cannam |
---|---|
date | Wed, 27 Jun 2012 15:04:58 +0100 |
parents | 5f33065ddc4b |
children | 433d4f72a19b |
comparison
equal
deleted
inserted
replaced
930:027cc0f5d4a2 | 931:ec1c49528f36 |
---|---|
145 assert_not_nil query | 145 assert_not_nil query |
146 assert_equal({'tracker_id' => {:operator => '=', :values => ['1']}}, query.filters) | 146 assert_equal({'tracker_id' => {:operator => '=', :values => ['1']}}, query.filters) |
147 end | 147 end |
148 | 148 |
149 def test_index_with_short_filters | 149 def test_index_with_short_filters |
150 | |
151 to_test = { | 150 to_test = { |
152 'status_id' => { | 151 'status_id' => { |
153 'o' => { :op => 'o', :values => [''] }, | 152 'o' => { :op => 'o', :values => [''] }, |
154 'c' => { :op => 'c', :values => [''] }, | 153 'c' => { :op => 'c', :values => [''] }, |
155 '7' => { :op => '=', :values => ['7'] }, | 154 '7' => { :op => '=', :values => ['7'] }, |
179 '>t-2' => { :op => '>t-', :values => ['2'] }, | 178 '>t-2' => { :op => '>t-', :values => ['2'] }, |
180 '<t-2' => { :op => '<t-', :values => ['2'] }, | 179 '<t-2' => { :op => '<t-', :values => ['2'] }, |
181 't-2' => { :op => 't-', :values => ['2'] }}, | 180 't-2' => { :op => 't-', :values => ['2'] }}, |
182 'created_on' => { | 181 'created_on' => { |
183 '>=2011-10-12' => { :op => '>=', :values => ['2011-10-12'] }, | 182 '>=2011-10-12' => { :op => '>=', :values => ['2011-10-12'] }, |
184 '<t+2' => { :op => '=', :values => ['<t+2'] }, | 183 '<t-2' => { :op => '<t-', :values => ['2'] }, |
185 '>t+2' => { :op => '=', :values => ['>t+2'] }, | 184 '>t-2' => { :op => '>t-', :values => ['2'] }, |
186 't+2' => { :op => 't', :values => ['+2'] }}, | 185 't-2' => { :op => 't-', :values => ['2'] }}, |
187 'cf_1' => { | 186 'cf_1' => { |
188 'c' => { :op => '=', :values => ['c'] }, | 187 'c' => { :op => '=', :values => ['c'] }, |
189 '!c' => { :op => '!', :values => ['c'] }, | 188 '!c' => { :op => '!', :values => ['c'] }, |
190 '!*' => { :op => '!*', :values => [''] }, | 189 '!*' => { :op => '!*', :values => [''] }, |
191 '*' => { :op => '*', :values => [''] }}, | 190 '*' => { :op => '*', :values => [''] }}, |
213 assert_not_nil query | 212 assert_not_nil query |
214 assert query.has_filter?(field) | 213 assert query.has_filter?(field) |
215 assert_equal(default_filter.merge({field => {:operator => expected[:op], :values => expected[:values]}}), query.filters) | 214 assert_equal(default_filter.merge({field => {:operator => expected[:op], :values => expected[:values]}}), query.filters) |
216 end | 215 end |
217 end | 216 end |
218 | |
219 end | 217 end |
220 | 218 |
221 def test_index_with_project_and_empty_filters | 219 def test_index_with_project_and_empty_filters |
222 get :index, :project_id => 1, :set_filter => 1, :fields => [''] | 220 get :index, :project_id => 1, :set_filter => 1, :fields => [''] |
223 assert_response :success | 221 assert_response :success |
931 end | 929 end |
932 | 930 |
933 def test_post_new_with_group_assignment | 931 def test_post_new_with_group_assignment |
934 group = Group.find(11) | 932 group = Group.find(11) |
935 project = Project.find(1) | 933 project = Project.find(1) |
936 project.members << Member.new(:principal => group, :roles => [Role.first]) | 934 project.members << Member.new(:principal => group, :roles => [Role.givable.first]) |
937 | 935 |
938 with_settings :issue_group_assignment => '1' do | 936 with_settings :issue_group_assignment => '1' do |
939 @request.session[:user_id] = 2 | 937 @request.session[:user_id] = 2 |
940 assert_difference 'Issue.count' do | 938 assert_difference 'Issue.count' do |
941 post :create, :project_id => project.id, | 939 post :create, :project_id => project.id, |
1801 end | 1799 end |
1802 | 1800 |
1803 def test_bulk_update_with_group_assignee | 1801 def test_bulk_update_with_group_assignee |
1804 group = Group.find(11) | 1802 group = Group.find(11) |
1805 project = Project.find(1) | 1803 project = Project.find(1) |
1806 project.members << Member.new(:principal => group, :roles => [Role.first]) | 1804 project.members << Member.new(:principal => group, :roles => [Role.givable.first]) |
1807 | 1805 |
1808 @request.session[:user_id] = 2 | 1806 @request.session[:user_id] = 2 |
1809 # update issues assignee | 1807 # update issues assignee |
1810 post :bulk_update, :ids => [1, 2], :notes => 'Bulk editing', | 1808 post :bulk_update, :ids => [1, 2], :notes => 'Bulk editing', |
1811 :issue => {:priority_id => '', | 1809 :issue => {:priority_id => '', |