You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

issues_import_test.rb 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # encoding: utf-8
  2. #
  3. # Redmine - project management software
  4. # Copyright (C) 2006-2017 Jean-Philippe Lang
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License
  8. # as published by the Free Software Foundation; either version 2
  9. # of the License, or (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. require File.expand_path('../../application_system_test_case', __FILE__)
  20. class IssuesImportTest < ApplicationSystemTestCase
  21. fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
  22. :trackers, :projects_trackers, :enabled_modules, :issue_statuses, :issues,
  23. :enumerations, :custom_fields, :custom_values, :custom_fields_trackers,
  24. :watchers, :journals, :journal_details
  25. def test_import_issues_without_failures
  26. log_user('jsmith', 'jsmith')
  27. visit '/issues'
  28. click_on 'Import'
  29. attach_file 'file', Rails.root.join('test/fixtures/files/import_issues.csv')
  30. click_on 'Next »'
  31. select 'Semicolon', :from => 'Field separator'
  32. select 'Double quote', :from => 'Field wrapper'
  33. select 'ISO-8859-1', :from => 'Encoding'
  34. select 'MM/DD/YYYY', :from => 'Date format'
  35. click_on 'Next »'
  36. select 'eCookbook', :from => 'Project'
  37. select 'tracker', :from => 'Tracker'
  38. select 'status', :from => 'Status'
  39. select 'subject', :from => 'Subject'
  40. assert_difference 'Issue.count', 3 do
  41. click_button 'Import'
  42. assert page.has_content?('3 items have been imported')
  43. end
  44. end
  45. end