summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-03 11:55:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-03 11:55:24 +0000
commitb0ade644d60c471e935f6b5f269d41824e0df8b8 (patch)
treec89a8a5199b70ee3f1bfe48d148010a23d5a90c3 /test
parent90ed0784458a16f57a73e2eb80bdcaa2398b092b (diff)
downloadredmine-b0ade644d60c471e935f6b5f269d41824e0df8b8.tar.gz
redmine-b0ade644d60c471e935f6b5f269d41824e0df8b8.zip
Changed timelogs filters to use non-AJAX requests (#1965).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5297 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/time_entry_reports_controller_test.rb10
-rw-r--r--test/functional/timelog_controller_test.rb22
2 files changed, 26 insertions, 6 deletions
diff --git a/test/functional/time_entry_reports_controller_test.rb b/test/functional/time_entry_reports_controller_test.rb
index 70a3d1c72..b53eebd7e 100644
--- a/test/functional/time_entry_reports_controller_test.rb
+++ b/test/functional/time_entry_reports_controller_test.rb
@@ -4,16 +4,20 @@ require File.expand_path('../../test_helper', __FILE__)
class TimeEntryReportsControllerTest < ActionController::TestCase
fixtures :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :time_entries, :users, :trackers, :enumerations, :issue_statuses, :custom_fields, :custom_values
- def test_report_no_criteria
- get :report, :project_id => 1
+ def test_report_at_project_level
+ get :report, :project_id => 'ecookbook'
assert_response :success
assert_template 'report'
+ assert_tag :form,
+ :attributes => {:action => "/projects/ecookbook/time_entries/report", :id => 'query_form'}
end
def test_report_all_projects
get :report
assert_response :success
assert_template 'report'
+ assert_tag :form,
+ :attributes => {:action => "/time_entries/report", :id => 'query_form'}
end
def test_report_all_projects_denied
@@ -80,6 +84,8 @@ class TimeEntryReportsControllerTest < ActionController::TestCase
assert_template 'report'
assert_not_nil assigns(:total_hours)
assert_equal "154.25", "%.2f" % assigns(:total_hours)
+ assert_tag :form,
+ :attributes => {:action => "/projects/ecookbook/issues/1/time_entries/report", :id => 'query_form'}
end
def test_report_custom_field_criteria
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index 634363dd1..669014d8a 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -163,10 +163,12 @@ class TimelogControllerTest < ActionController::TestCase
assert_template 'index'
assert_not_nil assigns(:total_hours)
assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ assert_tag :form,
+ :attributes => {:action => "/time_entries", :id => 'query_form'}
end
def test_index_at_project_level
- get :index, :project_id => 1
+ get :index, :project_id => 'ecookbook'
assert_response :success
assert_template 'index'
assert_not_nil assigns(:entries)
@@ -178,10 +180,12 @@ class TimelogControllerTest < ActionController::TestCase
# display all time by default
assert_equal '2007-03-12'.to_date, assigns(:from)
assert_equal '2007-04-22'.to_date, assigns(:to)
+ assert_tag :form,
+ :attributes => {:action => "/projects/ecookbook/time_entries", :id => 'query_form'}
end
def test_index_at_project_level_with_date_range
- get :index, :project_id => 1, :from => '2007-03-20', :to => '2007-04-30'
+ get :index, :project_id => 'ecookbook', :from => '2007-03-20', :to => '2007-04-30'
assert_response :success
assert_template 'index'
assert_not_nil assigns(:entries)
@@ -190,24 +194,30 @@ class TimelogControllerTest < ActionController::TestCase
assert_equal "12.90", "%.2f" % assigns(:total_hours)
assert_equal '2007-03-20'.to_date, assigns(:from)
assert_equal '2007-04-30'.to_date, assigns(:to)
+ assert_tag :form,
+ :attributes => {:action => "/projects/ecookbook/time_entries", :id => 'query_form'}
end
def test_index_at_project_level_with_period
- get :index, :project_id => 1, :period => '7_days'
+ get :index, :project_id => 'ecookbook', :period => '7_days'
assert_response :success
assert_template 'index'
assert_not_nil assigns(:entries)
assert_not_nil assigns(:total_hours)
assert_equal Date.today - 7, assigns(:from)
assert_equal Date.today, assigns(:to)
+ assert_tag :form,
+ :attributes => {:action => "/projects/ecookbook/time_entries", :id => 'query_form'}
end
def test_index_one_day
- get :index, :project_id => 1, :from => "2007-03-23", :to => "2007-03-23"
+ get :index, :project_id => 'ecookbook', :from => "2007-03-23", :to => "2007-03-23"
assert_response :success
assert_template 'index'
assert_not_nil assigns(:total_hours)
assert_equal "4.25", "%.2f" % assigns(:total_hours)
+ assert_tag :form,
+ :attributes => {:action => "/projects/ecookbook/time_entries", :id => 'query_form'}
end
def test_index_at_issue_level
@@ -221,6 +231,10 @@ class TimelogControllerTest < ActionController::TestCase
# display all time based on what's been logged
assert_equal '2007-03-12'.to_date, assigns(:from)
assert_equal '2007-04-22'.to_date, assigns(:to)
+ # TODO: remove /projects/:project_id/issues/:issue_id/time_entries routes
+ # to use /issues/:issue_id/time_entries
+ assert_tag :form,
+ :attributes => {:action => "/projects/ecookbook/issues/1/time_entries", :id => 'query_form'}
end
def test_index_atom_feed