annotate .svn/pristine/b5/b56a8e43fdd2558ce06b9e0aaade0e6568e56fc6.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +0100
parents dffacf8a6908
children
rev   line source
Chris@1517 1 # Redmine - project management software
Chris@1517 2 # Copyright (C) 2006-2014 Jean-Philippe Lang
Chris@1517 3 #
Chris@1517 4 # This program is free software; you can redistribute it and/or
Chris@1517 5 # modify it under the terms of the GNU General Public License
Chris@1517 6 # as published by the Free Software Foundation; either version 2
Chris@1517 7 # of the License, or (at your option) any later version.
Chris@1517 8 #
Chris@1517 9 # This program is distributed in the hope that it will be useful,
Chris@1517 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1517 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@1517 12 # GNU General Public License for more details.
Chris@1517 13 #
Chris@1517 14 # You should have received a copy of the GNU General Public License
Chris@1517 15 # along with this program; if not, write to the Free Software
Chris@1517 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@1517 17
Chris@1517 18 require File.expand_path('../../test_helper', __FILE__)
Chris@1517 19
Chris@1517 20 class CalendarsControllerTest < ActionController::TestCase
Chris@1517 21 fixtures :projects,
Chris@1517 22 :trackers,
Chris@1517 23 :projects_trackers,
Chris@1517 24 :roles,
Chris@1517 25 :member_roles,
Chris@1517 26 :members,
Chris@1517 27 :enabled_modules
Chris@1517 28
Chris@1517 29 def test_show
Chris@1517 30 get :show, :project_id => 1
Chris@1517 31 assert_response :success
Chris@1517 32 assert_template :partial => '_calendar'
Chris@1517 33 assert_not_nil assigns(:calendar)
Chris@1517 34 end
Chris@1517 35
Chris@1517 36 def test_show_should_run_custom_queries
Chris@1517 37 @query = IssueQuery.create!(:name => 'Calendar', :visibility => IssueQuery::VISIBILITY_PUBLIC)
Chris@1517 38
Chris@1517 39 get :show, :query_id => @query.id
Chris@1517 40 assert_response :success
Chris@1517 41 end
Chris@1517 42
Chris@1517 43 def test_cross_project_calendar
Chris@1517 44 get :show
Chris@1517 45 assert_response :success
Chris@1517 46 assert_template :partial => '_calendar'
Chris@1517 47 assert_not_nil assigns(:calendar)
Chris@1517 48 end
Chris@1517 49
Chris@1517 50 def test_week_number_calculation
Chris@1517 51 Setting.start_of_week = 7
Chris@1517 52
Chris@1517 53 get :show, :month => '1', :year => '2010'
Chris@1517 54 assert_response :success
Chris@1517 55
Chris@1517 56 assert_select 'tr' do
Chris@1517 57 assert_select 'td.week-number', :text => '53'
Chris@1517 58 assert_select 'td.odd', :text => '27'
Chris@1517 59 assert_select 'td.even', :text => '2'
Chris@1517 60 end
Chris@1517 61
Chris@1517 62 assert_select 'tr' do
Chris@1517 63 assert_select 'td.week-number', :text => '1'
Chris@1517 64 assert_select 'td.odd', :text => '3'
Chris@1517 65 assert_select 'td.even', :text => '9'
Chris@1517 66 end
Chris@1517 67
Chris@1517 68 Setting.start_of_week = 1
Chris@1517 69 get :show, :month => '1', :year => '2010'
Chris@1517 70 assert_response :success
Chris@1517 71
Chris@1517 72 assert_select 'tr' do
Chris@1517 73 assert_select 'td.week-number', :text => '53'
Chris@1517 74 assert_select 'td.even', :text => '28'
Chris@1517 75 assert_select 'td.even', :text => '3'
Chris@1517 76 end
Chris@1517 77
Chris@1517 78 assert_select 'tr' do
Chris@1517 79 assert_select 'td.week-number', :text => '1'
Chris@1517 80 assert_select 'td.even', :text => '4'
Chris@1517 81 assert_select 'td.even', :text => '10'
Chris@1517 82 end
Chris@1517 83 end
Chris@1517 84 end