Commit c52be151 authored by jplang's avatar jplang

Pass parameters with :params in controller tests.

git-svn-id: https://svn.redmine.org/redmine/trunk@15666 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 04db6049
......@@ -45,7 +45,7 @@ class RolesControllerTest < Redmine::ControllerTest
def test_new_with_copy
copy_from = Role.find(2)
get :new, :copy => copy_from.id.to_s
get :new, :params => {:copy => copy_from.id.to_s}
assert_response :success
assert_template 'new'
......@@ -68,20 +68,26 @@ class RolesControllerTest < Redmine::ControllerTest
end
def test_create_with_validaton_failure
post :create, :role => {:name => '',
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'}
post :create, :params => {
:role => {
:name => '',
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'
}
}
assert_response :success
assert_template 'new'
assert_select 'div#errorExplanation'
end
def test_create_without_workflow_copy
post :create, :role => {:name => 'RoleWithoutWorkflowCopy',
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'}
post :create, :params => {
:role => {
:name => 'RoleWithoutWorkflowCopy',
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'
}
}
assert_redirected_to '/roles'
role = Role.find_by_name('RoleWithoutWorkflowCopy')
assert_not_nil role
......@@ -90,11 +96,14 @@ class RolesControllerTest < Redmine::ControllerTest
end
def test_create_with_workflow_copy
post :create, :role => {:name => 'RoleWithWorkflowCopy',
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'},
:copy_workflow_from => '1'
post :create, :params => {
:role => {
:name => 'RoleWithWorkflowCopy',
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'
},
:copy_workflow_from => '1'
}
assert_redirected_to '/roles'
role = Role.find_by_name('RoleWithWorkflowCopy')
assert_not_nil role
......@@ -102,7 +111,7 @@ class RolesControllerTest < Redmine::ControllerTest
end
def test_edit
get :edit, :id => 1
get :edit, :params => {:id => 1}
assert_response :success
assert_template 'edit'
assert_equal Role.find(1), assigns(:role)
......@@ -110,34 +119,39 @@ class RolesControllerTest < Redmine::ControllerTest
end
def test_edit_anonymous
get :edit, :id => Role.anonymous.id
get :edit, :params => {:id => Role.anonymous.id}
assert_response :success
assert_template 'edit'
assert_select 'select[name=?]', 'role[issues_visibility]', 0
end
def test_edit_invalid_should_respond_with_404
get :edit, :id => 999
get :edit, :params => {:id => 999}
assert_response 404
end
def test_update
put :update, :id => 1,
:role => {:name => 'Manager',
:permissions => ['edit_project', ''],
:assignable => '0'}
put :update, :params => {
:id => 1,
:role => {
:name => 'Manager',
:permissions => ['edit_project', ''],
:assignable => '0'
}
}
assert_redirected_to '/roles'
role = Role.find(1)
assert_equal [:edit_project], role.permissions
end
def test_update_trackers_permissions
put :update, :id => 1, :role => {
:permissions_all_trackers => {'add_issues' => '0'},
:permissions_tracker_ids => {'add_issues' => ['1', '3', '']}
put :update, :params => {
:id => 1,
:role => {
:permissions_all_trackers => {'add_issues' => '0'},
:permissions_tracker_ids => {'add_issues' => ['1', '3', '']}
}
}
assert_redirected_to '/roles'
role = Role.find(1)
......@@ -149,7 +163,7 @@ class RolesControllerTest < Redmine::ControllerTest
end
def test_update_with_failure
put :update, :id => 1, :role => {:name => ''}
put :update, :params => {:id => 1, :role => {:name => ''}}
assert_response :success
assert_template 'edit'
end
......@@ -157,13 +171,13 @@ class RolesControllerTest < Redmine::ControllerTest
def test_destroy
r = Role.create!(:name => 'ToBeDestroyed', :permissions => [:view_wiki_pages])
delete :destroy, :id => r
delete :destroy, :params => {:id => r}
assert_redirected_to '/roles'
assert_nil Role.find_by_id(r.id)
end
def test_destroy_role_in_use
delete :destroy, :id => 1
delete :destroy, :params => {:id => 1}
assert_redirected_to '/roles'
assert_equal 'This role is in use and cannot be deleted.', flash[:error]
assert_not_nil Role.find_by_id(1)
......@@ -182,7 +196,13 @@ class RolesControllerTest < Redmine::ControllerTest
end
def test_post_permissions
post :permissions, :permissions => { '0' => '', '1' => ['edit_issues'], '3' => ['add_issues', 'delete_issues']}
post :permissions, :params => {
:permissions => {
'0' => '',
'1' => ['edit_issues'],
'3' => ['add_issues', 'delete_issues']
}
}
assert_redirected_to '/roles'
assert_equal [:edit_issues], Role.find(1).permissions
......@@ -191,33 +211,33 @@ class RolesControllerTest < Redmine::ControllerTest
end
def test_clear_all_permissions
post :permissions, :permissions => { '0' => '' }
post :permissions, :params => {:permissions => { '0' => '' }}
assert_redirected_to '/roles'
assert Role.find(1).permissions.empty?
end
def test_move_highest
put :update, :id => 3, :role => {:position => 1}
put :update, :params => {:id => 3, :role => {:position => 1}}
assert_redirected_to '/roles'
assert_equal 1, Role.find(3).position
end
def test_move_higher
position = Role.find(3).position
put :update, :id => 3, :role => {:position => position - 1}
put :update, :params => {:id => 3, :role => {:position => position - 1}}
assert_redirected_to '/roles'
assert_equal position - 1, Role.find(3).position
end
def test_move_lower
position = Role.find(2).position
put :update, :id => 2, :role => {:position => position + 1}
put :update, :params => {:id => 2, :role => {:position => position + 1}}
assert_redirected_to '/roles'
assert_equal position + 1, Role.find(2).position
end
def test_move_lowest
put :update, :id => 2, :role => {:position => Role.givable.count}
put :update, :params => {:id => 2, :role => {:position => Role.givable.count}}
assert_redirected_to '/roles'
assert_equal Role.givable.count, Role.find(2).position
end
......
This diff is collapsed.
......@@ -64,7 +64,7 @@ class SearchCustomFieldsVisibilityTest < Redmine::ControllerTest
@users_to_test.each do |user, fields|
@request.session[:user_id] = user.id
@fields.each_with_index do |field, i|
get :index, :q => "value#{i}"
get :index, :params => {:q => "value#{i}"}
assert_response :success
# we should get a result only if the custom field is visible
if fields.include?(field)
......
......@@ -35,7 +35,7 @@ class SessionsControllerTest < Redmine::ControllerTest
token = Token.create!(:user_id => 2, :action => 'session', :created_on => 10.hours.ago, :updated_on => 10.hours.ago)
created = token.reload.created_on
get :index, {}, {:user_id => 2, :tk => token.value}
get :index, :session => {:user_id => 2, :tk => token.value}
assert_response :success
token.reload
assert_equal created.to_i, token.created_on.to_i
......@@ -48,13 +48,13 @@ class SessionsControllerTest < Redmine::ControllerTest
token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created)
with_settings :session_lifetime => '0', :session_timeout => '0' do
get :index, {}, {:user_id => 2, :tk => token.value}
get :index, :session => {:user_id => 2, :tk => token.value}
assert_response :success
end
end
def test_user_session_without_token_should_be_reset
get :index, {}, {:user_id => 2}
get :index, :session => {:user_id => 2}
assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F'
end
......@@ -63,7 +63,7 @@ class SessionsControllerTest < Redmine::ControllerTest
token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created)
with_settings :session_timeout => '720' do
get :index, {}, {:user_id => 2, :tk => token.value}
get :index, :session => {:user_id => 2, :tk => token.value}
assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F'
end
end
......@@ -73,7 +73,7 @@ class SessionsControllerTest < Redmine::ControllerTest
token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created)
with_settings :session_timeout => '720' do
get :index, {}, {:user_id => 2, :tk => token.value}
get :index, :session => {:user_id => 2, :tk => token.value}
assert_response :success
end
end
......@@ -83,7 +83,7 @@ class SessionsControllerTest < Redmine::ControllerTest
token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created)
with_settings :session_timeout => '60' do
get :index, {}, {:user_id => 2, :tk => token.value}
get :index, :session => {:user_id => 2, :tk => token.value}
assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F'
end
end
......@@ -93,7 +93,7 @@ class SessionsControllerTest < Redmine::ControllerTest
token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created)
with_settings :session_timeout => '60' do
get :index, {}, {:user_id => 2, :tk => token.value}
get :index, :session => {:user_id => 2, :tk => token.value}
assert_response :success
end
end
......@@ -106,7 +106,7 @@ class SessionsControllerTest < Redmine::ControllerTest
autologin_token = Token.create!(:user_id => 2, :action => 'autologin', :created_on => 1.day.ago)
@request.cookies['autologin'] = autologin_token.value
get :index, {}, {:user_id => 2, :tk => token.value}
get :index, :session => {:user_id => 2, :tk => token.value}
assert_equal 2, session[:user_id]
assert_response :success
assert_not_equal token.value, session[:tk]
......@@ -122,7 +122,7 @@ class SessionsControllerTest < Redmine::ControllerTest
token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created)
with_settings :session_timeout => '60' do
get :index, {}, {:user_id => user.id, :tk => token.value}
get :index, :session => {:user_id => user.id, :tk => token.value}
assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F'
assert_include "Veuillez vous reconnecter", flash[:error]
assert_equal :fr, current_language
......
......@@ -73,11 +73,14 @@ class SettingsControllerTest < Redmine::ControllerTest
end
def test_post_edit_notifications
post :edit, :settings => {:mail_from => 'functional@test.foo',
:bcc_recipients => '0',
:notified_events => %w(issue_added issue_updated news_added),
:emails_footer => 'Test footer'
}
post :edit, :params => {
:settings => {
:mail_from => 'functional@test.foo',
:bcc_recipients => '0',
:notified_events => %w(issue_added issue_updated news_added),
:emails_footer => 'Test footer'
}
}
assert_redirected_to '/settings'
assert_equal 'functional@test.foo', Setting.mail_from
assert !Setting.bcc_recipients?
......@@ -125,12 +128,14 @@ class SettingsControllerTest < Redmine::ControllerTest
end
def test_post_edit_commit_update_keywords
post :edit, :settings => {
:commit_update_keywords => {
:keywords => ["resolves", "closes"],
:status_id => ["3", "5"],
:done_ratio => ["", "100"],
:if_tracker_id => ["", "2"]
post :edit, :params => {
:settings => {
:commit_update_keywords => {
:keywords => ["resolves", "closes"],
:status_id => ["3", "5"],
:done_ratio => ["", "100"],
:if_tracker_id => ["", "2"]
}
}
}
assert_redirected_to '/settings'
......@@ -142,10 +147,11 @@ class SettingsControllerTest < Redmine::ControllerTest
def test_post_edit_should_send_security_notification_for_notified_settings
ActionMailer::Base.deliveries.clear
post :edit, :settings => {
:login_required => 1
post :edit, :params => {
:settings => {
:login_required => 1
}
}
assert_not_nil (mail = ActionMailer::Base.deliveries.last)
assert_mail_body_match '0.0.0.0', mail
assert_mail_body_match I18n.t(:setting_login_required), mail
......@@ -161,19 +167,21 @@ class SettingsControllerTest < Redmine::ControllerTest
def test_post_edit_should_not_send_security_notification_for_non_notified_settings
ActionMailer::Base.deliveries.clear
post :edit, :settings => {
:app_title => 'MineRed'
post :edit, :params => {
:settings => {
:app_title => 'MineRed'
}
}
assert_nil (mail = ActionMailer::Base.deliveries.last)
end
def test_post_edit_should_not_send_security_notification_for_unchanged_settings
ActionMailer::Base.deliveries.clear
post :edit, :settings => {
:login_required => 0
post :edit, :params => {
:settings => {
:login_required => 0
}
}
assert_nil (mail = ActionMailer::Base.deliveries.last)
end
......@@ -185,7 +193,7 @@ class SettingsControllerTest < Redmine::ControllerTest
end
Setting.plugin_foo = {'sample_setting' => 'Plugin setting value'}
get :plugin, :id => 'foo'
get :plugin, :params => {:id => 'foo'}
assert_response :success
assert_template 'plugin'
assert_select 'form[action="/settings/plugin/foo"]' do
......@@ -196,14 +204,14 @@ class SettingsControllerTest < Redmine::ControllerTest
end
def test_get_invalid_plugin_settings
get :plugin, :id => 'none'
get :plugin, :params => {:id => 'none'}
assert_response 404
end
def test_get_non_configurable_plugin_settings
Redmine::Plugin.register(:foo) {}
get :plugin, :id => 'foo'
get :plugin, :params => {:id => 'foo'}
assert_response 404
ensure
......@@ -216,7 +224,10 @@ class SettingsControllerTest < Redmine::ControllerTest
:default => {'sample_setting' => 'Plugin setting value'}
end
post :plugin, :id => 'foo', :settings => {'sample_setting' => 'Value'}
post :plugin, :params => {
:id => 'foo',
:settings => {'sample_setting' => 'Value'}
}
assert_redirected_to '/settings/plugin/foo'
assert_equal({'sample_setting' => 'Value'}, Setting.plugin_foo)
......@@ -225,7 +236,10 @@ class SettingsControllerTest < Redmine::ControllerTest
def test_post_non_configurable_plugin_settings
Redmine::Plugin.register(:foo) {}
post :plugin, :id => 'foo', :settings => {'sample_setting' => 'Value'}
post :plugin, :params => {
:id => 'foo',
:settings => {'sample_setting' => 'Value'}
}
assert_response 404
ensure
......
......@@ -48,9 +48,11 @@ class SysControllerTest < Redmine::ControllerTest
def test_create_project_repository
assert_nil Project.find(4).repository
post :create_project_repository, :id => 4,
:vendor => 'Subversion',
:repository => { :url => 'file:///create/project/repository/subproject2'}
post :create_project_repository, :params => {
:id => 4,
:vendor => 'Subversion',
:repository => { :url => 'file:///create/project/repository/subproject2'}
}
assert_response :created
assert_equal 'application/xml', @response.content_type
......@@ -67,18 +69,20 @@ class SysControllerTest < Redmine::ControllerTest
end
def test_create_already_existing
post :create_project_repository, :id => 1,
post :create_project_repository, :params => {
:id => 1,
:vendor => 'Subversion',
:repository => { :url => 'file:///create/project/repository/subproject2'}
}
assert_response :conflict
end
def test_create_with_failure
post :create_project_repository, :id => 4,
post :create_project_repository, :params => {
:id => 4,
:vendor => 'Subversion',
:repository => { :url => 'invalid url'}
}
assert_response :unprocessable_entity
end
......@@ -90,18 +94,18 @@ class SysControllerTest < Redmine::ControllerTest
def test_fetch_changesets_one_project_by_identifier
Repository::Subversion.any_instance.expects(:fetch_changesets).once.returns(true)
get :fetch_changesets, :id => 'ecookbook'
get :fetch_changesets, :params => {:id => 'ecookbook'}
assert_response :success
end
def test_fetch_changesets_one_project_by_id
Repository::Subversion.any_instance.expects(:fetch_changesets).once.returns(true)
get :fetch_changesets, :id => '1'
get :fetch_changesets, :params => {:id => '1'}
assert_response :success
end
def test_fetch_changesets_unknown_project
get :fetch_changesets, :id => 'unknown'
get :fetch_changesets, :params => {:id => 'unknown'}
assert_response 404
end
......@@ -114,14 +118,14 @@ class SysControllerTest < Redmine::ControllerTest
def test_api_key
with_settings :sys_api_key => 'my_secret_key' do
get :projects, :key => 'my_secret_key'
get :projects, :params => {:key => 'my_secret_key'}
assert_response :success
end
end
def test_wrong_key_should_respond_with_403_error
with_settings :sys_api_enabled => 'my_secret_key' do
get :projects, :key => 'wrong_key'
get :projects, :params => {:key => 'wrong_key'}
assert_response 403
end
end
......
......@@ -35,7 +35,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_at_project_level
get :report, :project_id => 'ecookbook'
get :report, :params => {:project_id => 'ecookbook'}
assert_response :success
assert_template 'report'
assert_select 'form#query_form[action=?]', '/projects/ecookbook/time_entries/report'
......@@ -58,7 +58,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_all_projects_one_criteria
get :report, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']
get :report, :params => {:columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -66,7 +66,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_all_time
get :report, :project_id => 1, :criteria => ['project', 'issue']
get :report, :params => {:project_id => 1, :criteria => ['project', 'issue']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -74,7 +74,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_all_time_by_day
get :report, :project_id => 1, :criteria => ['project', 'issue'], :columns => 'day'
get :report, :params => {:project_id => 1, :criteria => ['project', 'issue'], :columns => 'day'}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -83,7 +83,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_one_criteria
get :report, :project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']
get :report, :params => {:project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criteria => ['project']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -91,7 +91,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_two_criteria
get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["user", "activity"]
get :report, :params => {:project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criteria => ["user", "activity"]}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -104,7 +104,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
CustomValue.create!(:customized => entry, :custom_field => field, :value => 'value1')
CustomValue.create!(:customized => entry, :custom_field => field, :value => 'value2')
get :report, :project_id => 1, :columns => 'day', :criteria => ["cf_#{field.id}"]
get :report, :params => {:project_id => 1, :columns => 'day', :criteria => ["cf_#{field.id}"]}
assert_response :success
end
......@@ -112,7 +112,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
TimeEntryCustomField.create!(:name => 'Single', :field_format => 'list', :possible_values => ['value1', 'value2'])
TimeEntryCustomField.create!(:name => 'Multi', :field_format => 'list', :multiple => true, :possible_values => ['value1', 'value2'])
get :report, :project_id => 1
get :report, :params => {:project_id => 1}
assert_response :success
assert_select 'select[name=?]', 'criteria[]' do
assert_select 'option', :text => 'Single'
......@@ -121,7 +121,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_one_day
get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criteria => ["user", "activity"]
get :report, :params => {:project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criteria => ["user", "activity"]}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -135,7 +135,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
TimeEntry.generate!(:hours => '8', :spent_on => '2010-01-01') # 2009-53
TimeEntry.generate!(:hours => '16', :spent_on => '2010-01-05') # 2010-1
get :report, :columns => 'week', :from => "2009-12-25", :to => "2010-01-05", :criteria => ["project"]
get :report, :params => {:columns => 'week', :from => "2009-12-25", :to => "2010-01-05", :criteria => ["project"]}
assert_response :success
assert_select '#time-report thead tr' do
......@@ -167,7 +167,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_with_association_custom_fields
get :report, :criteria => ['cf_1', 'cf_3', 'cf_7']
get :report, :params => {:criteria => ['cf_1', 'cf_3', 'cf_7']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -187,7 +187,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_one_criteria_no_result
get :report, :project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criteria => ['project']
get :report, :params => {:project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criteria => ['project']}
assert_response :success
assert_template 'report'
assert_not_nil assigns(:report)
......@@ -195,7 +195,7 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_status_criterion
get :report, :project_id => 1, :criteria => ['status']
get :report, :params => {:project_id => 1, :criteria => ['status']}
assert_response :success
assert_template 'report'
assert_select 'th', :text => 'Status'
......@@ -203,8 +203,13 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_all_projects_csv_export
get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30",
:criteria => ["project", "user", "activity"], :format => "csv"
get :report, :params => {
:columns => 'month',
:from => "2007-01-01",
:to => "2007-06-30",
:criteria => ["project", "user", "activity"],
:format => "csv"
}
assert_response :success
assert_equal 'text/csv; header=present', @response.content_type
lines = @response.body.chomp.split("\n")
......@@ -215,9 +220,14 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
end
def test_report_csv_export
get :report, :project_id => 1, :columns => 'month',
:from => "2007-01-01", :to => "2007-06-30",
:criteria => ["project", "user", "activity"], :format => "csv"
get :report, :params => {
:project_id => 1,
:columns => 'month',
:from => "2007-01-01",
:to => "2007-06-30",
:criteria => ["project", "user", "activity"],
:format => "csv"
}
assert_response :success
assert_equal 'text/csv; header=present', @response.content_type
lines = @response.body.chomp.split("\n")
......@@ -248,9 +258,14 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
assert_equal 3, te2.user_id
with_settings :default_language => "zh-TW" do
get :report, :project_id => 1, :columns => 'day',
:from => "2011-11-11", :to => "2011-11-11",
:criteria => ["user"], :format => "csv"
get :report, :params => {
:project_id => 1,
:columns => 'day',
:from => "2011-11-11",
:to => "2011-11-11",
:criteria => ["user"],
:format => "csv"
}
end
assert_response :success
assert_equal 'text/csv; header=present', @response.content_type
......@@ -290,9 +305,14 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
assert_equal 3, te2.user_id
with_settings :default_language => "zh-TW" do
get :report, :project_id => 1, :columns => 'day',
:from => "2011-11-11", :to => "2011-11-11",
:criteria => ["user"], :format => "csv"
get :report, :params => {
:project_id => 1,
:columns => 'day',
:from => "2011-11-11",
:to => "2011-11-11",
:criteria => ["user"],
:format => "csv"
}
end
assert_response :success
assert_equal 'text/csv; header=present', @response.content_type
......@@ -321,9 +341,14 @@ class TimeEntryReportsControllerTest < Redmine::ControllerTest
assert_equal 7.3, te2.hours
assert_equal 3, te2.user_id
get :report, :project_id => 1, :columns => 'day',
:from => "2011-11-11", :to => "2011-11-11",
:criteria => ["user"], :format => "csv"
get :report, :params => {
:project_id => 1,
:columns => 'day',
:from => "2011-11-11",
:to => "2011-11-11",
:criteria => ["user"],