From 96f83cc8f0f032554f771a59da22303cd473b878 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 5 Dec 2006 20:45:04 +0000 Subject: trunk moved from /trunk/redmine to /trunk git-svn-id: http://redmine.rubyforge.org/svn/trunk@67 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/fixtures/attachments.yml | 13 + test/fixtures/auth_sources.yml | 2 + test/fixtures/custom_fields.yml | 45 + test/fixtures/custom_fields_projects.yml | 2 + test/fixtures/custom_fields_trackers.yml | 10 + test/fixtures/custom_values.yml | 43 + test/fixtures/documents.yml | 2 + test/fixtures/enumerations.yml | 33 + test/fixtures/issue_categories.yml | 9 + test/fixtures/issue_statuses.yml | 37 + test/fixtures/issues.yml | 43 + test/fixtures/members.yml | 13 + test/fixtures/news.yml | 20 + test/fixtures/permissions.yml | 379 +++++++ test/fixtures/permissions_roles.yml | 379 +++++++ test/fixtures/projects.yml | 41 + test/fixtures/roles.yml | 10 + test/fixtures/tokens.yml | 1 + test/fixtures/trackers.yml | 13 + test/fixtures/user_preferences.yml | 5 + test/fixtures/users.yml | 61 + test/fixtures/versions.yml | 17 + test/fixtures/workflows.yml | 1621 +++++++++++++++++++++++++++ test/functional/my_controller_test.rb | 18 + test/functional/projects_controller_test.rb | 114 ++ test/integration/account_test.rb | 100 ++ test/integration/admin_test.rb | 61 + test/test_helper.rb | 55 + test/unit/member_test.rb | 51 + test/unit/project_test.rb | 79 ++ test/unit/token_test.rb | 10 + test/unit/user_preference_test.rb | 10 + test/unit/user_test.rb | 88 ++ 33 files changed, 3385 insertions(+) create mode 100644 test/fixtures/attachments.yml create mode 100644 test/fixtures/auth_sources.yml create mode 100644 test/fixtures/custom_fields.yml create mode 100644 test/fixtures/custom_fields_projects.yml create mode 100644 test/fixtures/custom_fields_trackers.yml create mode 100644 test/fixtures/custom_values.yml create mode 100644 test/fixtures/documents.yml create mode 100644 test/fixtures/enumerations.yml create mode 100644 test/fixtures/issue_categories.yml create mode 100644 test/fixtures/issue_statuses.yml create mode 100644 test/fixtures/issues.yml create mode 100644 test/fixtures/members.yml create mode 100644 test/fixtures/news.yml create mode 100644 test/fixtures/permissions.yml create mode 100644 test/fixtures/permissions_roles.yml create mode 100644 test/fixtures/projects.yml create mode 100644 test/fixtures/roles.yml create mode 100644 test/fixtures/tokens.yml create mode 100644 test/fixtures/trackers.yml create mode 100644 test/fixtures/user_preferences.yml create mode 100644 test/fixtures/users.yml create mode 100644 test/fixtures/versions.yml create mode 100644 test/fixtures/workflows.yml create mode 100644 test/functional/my_controller_test.rb create mode 100644 test/functional/projects_controller_test.rb create mode 100644 test/integration/account_test.rb create mode 100644 test/integration/admin_test.rb create mode 100644 test/test_helper.rb create mode 100644 test/unit/member_test.rb create mode 100644 test/unit/project_test.rb create mode 100644 test/unit/token_test.rb create mode 100644 test/unit/user_preference_test.rb create mode 100644 test/unit/user_test.rb (limited to 'test') diff --git a/test/fixtures/attachments.yml b/test/fixtures/attachments.yml new file mode 100644 index 000000000..6c352e1e3 --- /dev/null +++ b/test/fixtures/attachments.yml @@ -0,0 +1,13 @@ +--- +attachments_001: + created_on: 2006-07-19 21:07:27 +02:00 + downloads: 0 + content_type: text/plain + disk_filename: 060719210727_error281.txt + container_id: 3 + digest: b91e08d0cf966d5c6ff411bd8c4cc3a2 + id: 1 + container_type: Issue + filesize: 28 + filename: error281.txt + author_id: 2 diff --git a/test/fixtures/auth_sources.yml b/test/fixtures/auth_sources.yml new file mode 100644 index 000000000..086c00f62 --- /dev/null +++ b/test/fixtures/auth_sources.yml @@ -0,0 +1,2 @@ +--- {} + diff --git a/test/fixtures/custom_fields.yml b/test/fixtures/custom_fields.yml new file mode 100644 index 000000000..fcf52c17a --- /dev/null +++ b/test/fixtures/custom_fields.yml @@ -0,0 +1,45 @@ +--- +custom_fields_001: + name: Database + min_length: 0 + regexp: "" + is_for_all: false + type: IssueCustomField + max_length: 0 + possible_values: MySQL|PostgreSQL|Oracle + id: 1 + is_required: false + field_format: list +custom_fields_002: + name: Build + min_length: 1 + regexp: "" + is_for_all: true + type: IssueCustomField + max_length: 10 + possible_values: "" + id: 2 + is_required: false + field_format: string +custom_fields_003: + name: Development status + min_length: 0 + regexp: "" + is_for_all: false + type: ProjectCustomField + max_length: 0 + possible_values: Stable|Beta|Alpha|Planning + id: 3 + is_required: true + field_format: list +custom_fields_004: + name: Phone number + min_length: 0 + regexp: "" + is_for_all: false + type: UserCustomField + max_length: 0 + possible_values: "" + id: 4 + is_required: false + field_format: string diff --git a/test/fixtures/custom_fields_projects.yml b/test/fixtures/custom_fields_projects.yml new file mode 100644 index 000000000..086c00f62 --- /dev/null +++ b/test/fixtures/custom_fields_projects.yml @@ -0,0 +1,2 @@ +--- {} + diff --git a/test/fixtures/custom_fields_trackers.yml b/test/fixtures/custom_fields_trackers.yml new file mode 100644 index 000000000..cb06d2fcf --- /dev/null +++ b/test/fixtures/custom_fields_trackers.yml @@ -0,0 +1,10 @@ +--- +custom_fields_trackers_001: + custom_field_id: 1 + tracker_id: 1 +custom_fields_trackers_002: + custom_field_id: 2 + tracker_id: 1 +custom_fields_trackers_003: + custom_field_id: 2 + tracker_id: 3 diff --git a/test/fixtures/custom_values.yml b/test/fixtures/custom_values.yml new file mode 100644 index 000000000..4a65619c4 --- /dev/null +++ b/test/fixtures/custom_values.yml @@ -0,0 +1,43 @@ +--- +custom_values_006: + customized_type: Issue + custom_field_id: 2 + customized_id: 3 + id: 9 + value: "125" +custom_values_007: + customized_type: Project + custom_field_id: 3 + customized_id: 1 + id: 10 + value: Stable +custom_values_001: + customized_type: User + custom_field_id: 4 + customized_id: 3 + id: 2 + value: "" +custom_values_002: + customized_type: User + custom_field_id: 4 + customized_id: 4 + id: 3 + value: 01 23 45 67 89 +custom_values_003: + customized_type: User + custom_field_id: 4 + customized_id: 2 + id: 4 + value: "" +custom_values_004: + customized_type: Issue + custom_field_id: 2 + customized_id: 1 + id: 7 + value: "101" +custom_values_005: + customized_type: Issue + custom_field_id: 2 + customized_id: 2 + id: 8 + value: "" diff --git a/test/fixtures/documents.yml b/test/fixtures/documents.yml new file mode 100644 index 000000000..086c00f62 --- /dev/null +++ b/test/fixtures/documents.yml @@ -0,0 +1,2 @@ +--- {} + diff --git a/test/fixtures/enumerations.yml b/test/fixtures/enumerations.yml new file mode 100644 index 000000000..eeef99b5b --- /dev/null +++ b/test/fixtures/enumerations.yml @@ -0,0 +1,33 @@ +--- +enumerations_001: + name: Uncategorized + id: 1 + opt: DCAT +enumerations_002: + name: User documentation + id: 2 + opt: DCAT +enumerations_003: + name: Technical documentation + id: 3 + opt: DCAT +enumerations_004: + name: Low + id: 4 + opt: IPRI +enumerations_005: + name: Normal + id: 5 + opt: IPRI +enumerations_006: + name: High + id: 6 + opt: IPRI +enumerations_007: + name: Urgent + id: 7 + opt: IPRI +enumerations_008: + name: Immediate + id: 8 + opt: IPRI diff --git a/test/fixtures/issue_categories.yml b/test/fixtures/issue_categories.yml new file mode 100644 index 000000000..a994560d4 --- /dev/null +++ b/test/fixtures/issue_categories.yml @@ -0,0 +1,9 @@ +--- +issue_categories_001: + name: Printing + project_id: 1 + id: 1 +issue_categories_002: + name: Recipes + project_id: 1 + id: 2 diff --git a/test/fixtures/issue_statuses.yml b/test/fixtures/issue_statuses.yml new file mode 100644 index 000000000..b5a509f39 --- /dev/null +++ b/test/fixtures/issue_statuses.yml @@ -0,0 +1,37 @@ +--- +issue_statuses_006: + name: Rejected + is_default: false + html_color: F5C28B + is_closed: true + id: 6 +issue_statuses_001: + name: New + is_default: true + html_color: F98787 + is_closed: false + id: 1 +issue_statuses_002: + name: Assigned + is_default: false + html_color: C0C0FF + is_closed: false + id: 2 +issue_statuses_003: + name: Resolved + is_default: false + html_color: 88E0B3 + is_closed: false + id: 3 +issue_statuses_004: + name: Feedback + is_default: false + html_color: F3A4F4 + is_closed: false + id: 4 +issue_statuses_005: + name: Closed + is_default: false + html_color: DBDBDB + is_closed: true + id: 5 diff --git a/test/fixtures/issues.yml b/test/fixtures/issues.yml new file mode 100644 index 000000000..5719a9bc9 --- /dev/null +++ b/test/fixtures/issues.yml @@ -0,0 +1,43 @@ +--- +issues_001: + created_on: 2006-07-19 21:02:17 +02:00 + project_id: 1 + updated_on: 2006-07-19 21:04:30 +02:00 + priority_id: 4 + subject: Can't print recipes + id: 1 + fixed_version_id: + category_id: 1 + description: Unable to print recipes + tracker_id: 1 + assigned_to_id: + author_id: 2 + status_id: 1 +issues_002: + created_on: 2006-07-19 21:04:21 +02:00 + project_id: 1 + updated_on: 2006-07-19 21:09:50 +02:00 + priority_id: 5 + subject: Add ingredients categories + id: 2 + fixed_version_id: + category_id: + description: Ingredients should be classified by categories + tracker_id: 2 + assigned_to_id: 3 + author_id: 2 + status_id: 2 +issues_003: + created_on: 2006-07-19 21:07:27 +02:00 + project_id: 1 + updated_on: 2006-07-19 21:07:27 +02:00 + priority_id: 4 + subject: Error 281 when updating a recipe + id: 3 + fixed_version_id: + category_id: + description: Error 281 is encountered when saving a recipe + tracker_id: 1 + assigned_to_id: + author_id: 2 + status_id: 1 diff --git a/test/fixtures/members.yml b/test/fixtures/members.yml new file mode 100644 index 000000000..0626bdb18 --- /dev/null +++ b/test/fixtures/members.yml @@ -0,0 +1,13 @@ +--- +members_001: + created_on: 2006-07-19 19:35:33 +02:00 + project_id: 1 + role_id: 1 + id: 1 + user_id: 2 +members_002: + created_on: 2006-07-19 19:35:36 +02:00 + project_id: 1 + role_id: 2 + id: 2 + user_id: 3 diff --git a/test/fixtures/news.yml b/test/fixtures/news.yml new file mode 100644 index 000000000..1bef9184e --- /dev/null +++ b/test/fixtures/news.yml @@ -0,0 +1,20 @@ +--- +news_001: + created_on: 2006-07-19 22:40:26 +02:00 + project_id: 1 + title: eCookbook first release ! + id: 1 + description: |- + eCookbook 1.0 has been released. + + Visit http://ecookbook.somenet.foo/ + summary: First version was released... + author_id: 2 +news_002: + created_on: 2006-07-19 22:42:58 +02:00 + project_id: 1 + title: 100,000 downloads for eCookbook + id: 2 + description: eCookbook 1.0 have downloaded 100,000 times + summary: eCookbook 1.0 have downloaded 100,000 times + author_id: 2 diff --git a/test/fixtures/permissions.yml b/test/fixtures/permissions.yml new file mode 100644 index 000000000..81350e1af --- /dev/null +++ b/test/fixtures/permissions.yml @@ -0,0 +1,379 @@ +--- +permissions_041: + action: add_file + id: 41 + description: button_add + controller: projects + mail_enabled: false + mail_option: false + sort: 1320 + is_public: false +permissions_030: + action: destroy + id: 30 + description: button_delete + controller: news + mail_enabled: false + mail_option: false + sort: 1122 + is_public: false +permissions_019: + action: download + id: 19 + description: button_download + controller: issues + mail_enabled: false + mail_option: false + sort: 1010 + is_public: true +permissions_008: + action: edit + id: 8 + description: button_edit + controller: members + mail_enabled: false + mail_option: false + sort: 221 + is_public: false +permissions_042: + action: destroy_file + id: 42 + description: button_delete + controller: versions + mail_enabled: false + mail_option: false + sort: 1322 + is_public: false +permissions_031: + action: list_documents + id: 31 + description: button_list + controller: projects + mail_enabled: false + mail_option: false + sort: 1200 + is_public: true +permissions_020: + action: add_issue + id: 20 + description: button_add + controller: projects + mail_enabled: true + mail_option: true + sort: 1050 + is_public: false +permissions_009: + action: destroy + id: 9 + description: button_delete + controller: members + mail_enabled: false + mail_option: false + sort: 222 + is_public: false +permissions_032: + action: show + id: 32 + description: button_view + controller: documents + mail_enabled: false + mail_option: false + sort: 1201 + is_public: true +permissions_021: + action: edit + id: 21 + description: button_edit + controller: issues + mail_enabled: false + mail_option: false + sort: 1055 + is_public: false +permissions_010: + action: add_version + id: 10 + description: button_add + controller: projects + mail_enabled: false + mail_option: false + sort: 320 + is_public: false +permissions_033: + action: download + id: 33 + description: button_download + controller: documents + mail_enabled: false + mail_option: false + sort: 1202 + is_public: true +permissions_022: + action: change_status + id: 22 + description: label_change_status + controller: issues + mail_enabled: true + mail_option: true + sort: 1060 + is_public: false +permissions_011: + action: edit + id: 11 + description: button_edit + controller: versions + mail_enabled: false + mail_option: false + sort: 321 + is_public: false +permissions_034: + action: add_document + id: 34 + description: button_add + controller: projects + mail_enabled: false + mail_option: false + sort: 1220 + is_public: false +permissions_023: + action: destroy + id: 23 + description: button_delete + controller: issues + mail_enabled: false + mail_option: false + sort: 1065 + is_public: false +permissions_012: + action: destroy + id: 12 + description: button_delete + controller: versions + mail_enabled: false + mail_option: false + sort: 322 + is_public: false +permissions_001: + action: show + id: 1 + description: label_overview + controller: projects + mail_enabled: false + mail_option: false + sort: 100 + is_public: true +permissions_035: + action: edit + id: 35 + description: button_edit + controller: documents + mail_enabled: false + mail_option: false + sort: 1221 + is_public: false +permissions_024: + action: add_attachment + id: 24 + description: label_attachment_new + controller: issues + mail_enabled: false + mail_option: false + sort: 1070 + is_public: false +permissions_013: + action: add_issue_category + id: 13 + description: button_add + controller: projects + mail_enabled: false + mail_option: false + sort: 420 + is_public: false +permissions_002: + action: changelog + id: 2 + description: label_change_log + controller: projects + mail_enabled: false + mail_option: false + sort: 105 + is_public: true +permissions_036: + action: destroy + id: 36 + description: button_delete + controller: documents + mail_enabled: false + mail_option: false + sort: 1222 + is_public: false +permissions_025: + action: destroy_attachment + id: 25 + description: label_attachment_delete + controller: issues + mail_enabled: false + mail_option: false + sort: 1075 + is_public: false +permissions_014: + action: edit + id: 14 + description: button_edit + controller: issue_categories + mail_enabled: false + mail_option: false + sort: 421 + is_public: false +permissions_003: + action: issue_report + id: 3 + description: label_report_plural + controller: reports + mail_enabled: false + mail_option: false + sort: 110 + is_public: true +permissions_037: + action: add_attachment + id: 37 + description: label_attachment_new + controller: documents + mail_enabled: false + mail_option: false + sort: 1223 + is_public: false +permissions_026: + action: list_news + id: 26 + description: button_list + controller: projects + mail_enabled: false + mail_option: false + sort: 1100 + is_public: true +permissions_015: + action: destroy + id: 15 + description: button_delete + controller: issue_categories + mail_enabled: false + mail_option: false + sort: 422 + is_public: false +permissions_004: + action: settings + id: 4 + description: label_settings + controller: projects + mail_enabled: false + mail_option: false + sort: 150 + is_public: false +permissions_038: + action: destroy_attachment + id: 38 + description: label_attachment_delete + controller: documents + mail_enabled: false + mail_option: false + sort: 1224 + is_public: false +permissions_027: + action: show + id: 27 + description: button_view + controller: news + mail_enabled: false + mail_option: false + sort: 1101 + is_public: true +permissions_016: + action: list_issues + id: 16 + description: button_list + controller: projects + mail_enabled: false + mail_option: false + sort: 1000 + is_public: true +permissions_005: + action: edit + id: 5 + description: button_edit + controller: projects + mail_enabled: false + mail_option: false + sort: 151 + is_public: false +permissions_039: + action: list_files + id: 39 + description: button_list + controller: projects + mail_enabled: false + mail_option: false + sort: 1300 + is_public: true +permissions_028: + action: add_news + id: 28 + description: button_add + controller: projects + mail_enabled: false + mail_option: false + sort: 1120 + is_public: false +permissions_017: + action: export_issues_csv + id: 17 + description: label_export_csv + controller: projects + mail_enabled: false + mail_option: false + sort: 1001 + is_public: true +permissions_006: + action: list_members + id: 6 + description: button_list + controller: projects + mail_enabled: false + mail_option: false + sort: 200 + is_public: true +permissions_040: + action: download + id: 40 + description: button_download + controller: versions + mail_enabled: false + mail_option: false + sort: 1301 + is_public: true +permissions_029: + action: edit + id: 29 + description: button_edit + controller: news + mail_enabled: false + mail_option: false + sort: 1121 + is_public: false +permissions_018: + action: show + id: 18 + description: button_view + controller: issues + mail_enabled: false + mail_option: false + sort: 1005 + is_public: true +permissions_007: + action: add_member + id: 7 + description: button_add + controller: projects + mail_enabled: false + mail_option: false + sort: 220 + is_public: false diff --git a/test/fixtures/permissions_roles.yml b/test/fixtures/permissions_roles.yml new file mode 100644 index 000000000..d4a054ecc --- /dev/null +++ b/test/fixtures/permissions_roles.yml @@ -0,0 +1,379 @@ +--- +permissions_roles_075: + role_id: 3 + permission_id: 34 +permissions_roles_047: + role_id: 1 + permission_id: 15 +permissions_roles_102: + role_id: 2 + permission_id: 4 +permissions_roles_019: + role_id: 3 + permission_id: 30 +permissions_roles_048: + role_id: 2 + permission_id: 24 +permissions_roles_103: + role_id: 2 + permission_id: 27 +permissions_roles_076: + role_id: 2 + permission_id: 41 +permissions_roles_049: + role_id: 1 + permission_id: 3 +permissions_roles_104: + role_id: 2 + permission_id: 36 +permissions_roles_077: + role_id: 2 + permission_id: 7 +permissions_roles_105: + role_id: 2 + permission_id: 32 +permissions_roles_078: + role_id: 3 + permission_id: 38 +permissions_roles_106: + role_id: 2 + permission_id: 14 +permissions_roles_020: + role_id: 2 + permission_id: 9 +permissions_roles_079: + role_id: 2 + permission_id: 18 +permissions_roles_107: + role_id: 3 + permission_id: 40 +permissions_roles_021: + role_id: 1 + permission_id: 13 +permissions_roles_108: + role_id: 1 + permission_id: 29 +permissions_roles_050: + role_id: 2 + permission_id: 29 +permissions_roles_022: + role_id: 3 + permission_id: 4 +permissions_roles_109: + role_id: 3 + permission_id: 22 +permissions_roles_051: + role_id: 3 + permission_id: 37 +permissions_roles_023: + role_id: 1 + permission_id: 23 +permissions_roles_052: + role_id: 2 + permission_id: 33 +permissions_roles_024: + role_id: 1 + permission_id: 1 +permissions_roles_080: + role_id: 2 + permission_id: 13 +permissions_roles_053: + role_id: 2 + permission_id: 1 +permissions_roles_025: + role_id: 2 + permission_id: 10 +permissions_roles_081: + role_id: 3 + permission_id: 20 +permissions_roles_054: + role_id: 2 + permission_id: 12 +permissions_roles_026: + role_id: 1 + permission_id: 36 +permissions_roles_082: + role_id: 1 + permission_id: 39 +permissions_roles_110: + role_id: 3 + permission_id: 6 +permissions_roles_027: + role_id: 3 + permission_id: 31 +permissions_roles_083: + role_id: 1 + permission_id: 33 +permissions_roles_055: + role_id: 1 + permission_id: 38 +permissions_roles_111: + role_id: 3 + permission_id: 1 +permissions_roles_028: + role_id: 1 + permission_id: 24 +permissions_roles_084: + role_id: 3 + permission_id: 16 +permissions_roles_056: + role_id: 2 + permission_id: 5 +permissions_roles_029: + role_id: 1 + permission_id: 9 +permissions_roles_085: + role_id: 3 + permission_id: 27 +permissions_roles_057: + role_id: 1 + permission_id: 16 +permissions_roles_112: + role_id: 1 + permission_id: 20 +permissions_roles_086: + role_id: 3 + permission_id: 12 +permissions_roles_058: + role_id: 1 + permission_id: 26 +permissions_roles_113: + role_id: 2 + permission_id: 37 +permissions_roles_087: + role_id: 1 + permission_id: 5 +permissions_roles_059: + role_id: 3 + permission_id: 18 +permissions_roles_114: + role_id: 2 + permission_id: 20 +permissions_roles_115: + role_id: 2 + permission_id: 15 +permissions_roles_088: + role_id: 2 + permission_id: 3 +permissions_roles_001: + role_id: 2 + permission_id: 21 +permissions_roles_116: + role_id: 3 + permission_id: 23 +permissions_roles_030: + role_id: 1 + permission_id: 30 +permissions_roles_089: + role_id: 1 + permission_id: 28 +permissions_roles_002: + role_id: 3 + permission_id: 29 +permissions_roles_117: + role_id: 3 + permission_id: 28 +permissions_roles_031: + role_id: 2 + permission_id: 38 +permissions_roles_003: + role_id: 3 + permission_id: 41 +permissions_roles_118: + role_id: 1 + permission_id: 34 +permissions_roles_032: + role_id: 3 + permission_id: 9 +permissions_roles_004: + role_id: 2 + permission_id: 8 +permissions_roles_060: + role_id: 2 + permission_id: 2 +permissions_roles_119: + role_id: 1 + permission_id: 21 +permissions_roles_033: + role_id: 2 + permission_id: 28 +permissions_roles_005: + role_id: 3 + permission_id: 3 +permissions_roles_061: + role_id: 2 + permission_id: 40 +permissions_roles_006: + role_id: 3 + permission_id: 14 +permissions_roles_090: + role_id: 2 + permission_id: 26 +permissions_roles_062: + role_id: 1 + permission_id: 19 +permissions_roles_034: + role_id: 2 + permission_id: 11 +permissions_roles_007: + role_id: 1 + permission_id: 35 +permissions_roles_091: + role_id: 3 + permission_id: 35 +permissions_roles_063: + role_id: 2 + permission_id: 30 +permissions_roles_035: + role_id: 2 + permission_id: 23 +permissions_roles_008: + role_id: 2 + permission_id: 17 +permissions_roles_092: + role_id: 2 + permission_id: 31 +permissions_roles_064: + role_id: 3 + permission_id: 33 +permissions_roles_036: + role_id: 3 + permission_id: 5 +permissions_roles_120: + role_id: 3 + permission_id: 13 +permissions_roles_009: + role_id: 1 + permission_id: 12 +permissions_roles_093: + role_id: 2 + permission_id: 42 +permissions_roles_065: + role_id: 3 + permission_id: 26 +permissions_roles_037: + role_id: 1 + permission_id: 42 +permissions_roles_121: + role_id: 3 + permission_id: 2 +permissions_roles_094: + role_id: 3 + permission_id: 39 +permissions_roles_066: + role_id: 2 + permission_id: 6 +permissions_roles_038: + role_id: 1 + permission_id: 25 +permissions_roles_122: + role_id: 1 + permission_id: 7 +permissions_roles_095: + role_id: 2 + permission_id: 19 +permissions_roles_067: + role_id: 1 + permission_id: 17 +permissions_roles_039: + role_id: 3 + permission_id: 36 +permissions_roles_123: + role_id: 3 + permission_id: 24 +permissions_roles_096: + role_id: 1 + permission_id: 18 +permissions_roles_068: + role_id: 1 + permission_id: 32 +permissions_roles_124: + role_id: 1 + permission_id: 11 +permissions_roles_010: + role_id: 1 + permission_id: 8 +permissions_roles_069: + role_id: 3 + permission_id: 19 +permissions_roles_097: + role_id: 2 + permission_id: 35 +permissions_roles_125: + role_id: 2 + permission_id: 16 +permissions_roles_011: + role_id: 3 + permission_id: 42 +permissions_roles_098: + role_id: 1 + permission_id: 6 +permissions_roles_126: + role_id: 3 + permission_id: 7 +permissions_roles_012: + role_id: 3 + permission_id: 8 +permissions_roles_040: + role_id: 1 + permission_id: 2 +permissions_roles_099: + role_id: 3 + permission_id: 17 +permissions_roles_041: + role_id: 2 + permission_id: 39 +permissions_roles_013: + role_id: 1 + permission_id: 40 +permissions_roles_070: + role_id: 3 + permission_id: 11 +permissions_roles_042: + role_id: 1 + permission_id: 37 +permissions_roles_014: + role_id: 1 + permission_id: 22 +permissions_roles_071: + role_id: 1 + permission_id: 4 +permissions_roles_043: + role_id: 3 + permission_id: 32 +permissions_roles_015: + role_id: 2 + permission_id: 22 +permissions_roles_072: + role_id: 1 + permission_id: 27 +permissions_roles_044: + role_id: 1 + permission_id: 14 +permissions_roles_016: + role_id: 3 + permission_id: 15 +permissions_roles_073: + role_id: 2 + permission_id: 34 +permissions_roles_045: + role_id: 3 + permission_id: 10 +permissions_roles_100: + role_id: 1 + permission_id: 10 +permissions_roles_017: + role_id: 3 + permission_id: 25 +permissions_roles_074: + role_id: 2 + permission_id: 25 +permissions_roles_046: + role_id: 1 + permission_id: 31 +permissions_roles_101: + role_id: 3 + permission_id: 21 +permissions_roles_018: + role_id: 1 + permission_id: 41 diff --git a/test/fixtures/projects.yml b/test/fixtures/projects.yml new file mode 100644 index 000000000..9aa2f9abe --- /dev/null +++ b/test/fixtures/projects.yml @@ -0,0 +1,41 @@ +--- +projects_001: + created_on: 2006-07-19 19:13:59 +02:00 + name: eCookbook + updated_on: 2006-07-19 22:53:01 +02:00 + projects_count: 2 + id: 1 + description: Recipes management application + homepage: http://ecookbook.somenet.foo/ + is_public: true + parent_id: +projects_002: + created_on: 2006-07-19 19:14:19 +02:00 + name: OnlineStore + updated_on: 2006-07-19 19:14:19 +02:00 + projects_count: 0 + id: 2 + description: E-commerce web site + homepage: "" + is_public: false + parent_id: +projects_003: + created_on: 2006-07-19 19:15:21 +02:00 + name: eCookbook Subproject 1 + updated_on: 2006-07-19 19:18:12 +02:00 + projects_count: 0 + id: 3 + description: eCookBook Subproject 1 + homepage: "" + is_public: true + parent_id: 1 +projects_004: + created_on: 2006-07-19 19:15:51 +02:00 + name: eCookbook Subproject 2 + updated_on: 2006-07-19 19:17:07 +02:00 + projects_count: 0 + id: 4 + description: eCookbook Subproject 2 + homepage: "" + is_public: true + parent_id: 1 diff --git a/test/fixtures/roles.yml b/test/fixtures/roles.yml new file mode 100644 index 000000000..4fc9881b4 --- /dev/null +++ b/test/fixtures/roles.yml @@ -0,0 +1,10 @@ +--- +roles_001: + name: Manager + id: 1 +roles_002: + name: Developer + id: 2 +roles_003: + name: Reporter + id: 3 diff --git a/test/fixtures/tokens.yml b/test/fixtures/tokens.yml new file mode 100644 index 000000000..977bafe6e --- /dev/null +++ b/test/fixtures/tokens.yml @@ -0,0 +1 @@ +--- diff --git a/test/fixtures/trackers.yml b/test/fixtures/trackers.yml new file mode 100644 index 000000000..d4ea34ac8 --- /dev/null +++ b/test/fixtures/trackers.yml @@ -0,0 +1,13 @@ +--- +trackers_001: + name: Bug + id: 1 + is_in_chlog: true +trackers_002: + name: Feature request + id: 2 + is_in_chlog: true +trackers_003: + name: Support request + id: 3 + is_in_chlog: false diff --git a/test/fixtures/user_preferences.yml b/test/fixtures/user_preferences.yml new file mode 100644 index 000000000..8794d28ae --- /dev/null +++ b/test/fixtures/user_preferences.yml @@ -0,0 +1,5 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +first: + id: 1 +another: + id: 2 diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 000000000..ffa2fe42e --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,61 @@ +--- +users_004: + created_on: 2006-07-19 19:34:07 +02:00 + status: 1 + last_login_on: + language: en + hashed_password: 4e4aeb7baaf0706bd670263fef42dad15763b608 + updated_on: 2006-07-19 19:34:07 +02:00 + admin: false + mail: rhill@somenet.foo + lastname: Hill + firstname: Robert + id: 4 + auth_source_id: + mail_notification: true + login: rhill +users_001: + created_on: 2006-07-19 19:12:21 +02:00 + status: 1 + last_login_on: 2006-07-19 22:57:52 +02:00 + language: en + hashed_password: d033e22ae348aeb5660fc2140aec35850c4da997 + updated_on: 2006-07-19 22:57:52 +02:00 + admin: true + mail: admin@somenet.foo + lastname: Admin + firstname: redMine + id: 1 + auth_source_id: + mail_notification: true + login: admin +users_002: + created_on: 2006-07-19 19:32:09 +02:00 + status: 1 + last_login_on: 2006-07-19 22:42:15 +02:00 + language: en + hashed_password: a9a653d4151fa2c081ba1ffc2c2726f3b80b7d7d + updated_on: 2006-07-19 22:42:15 +02:00 + admin: false + mail: jsmith@somenet.foo + lastname: Smith + firstname: John + id: 2 + auth_source_id: + mail_notification: true + login: jsmith +users_003: + created_on: 2006-07-19 19:33:19 +02:00 + status: 1 + last_login_on: + language: en + hashed_password: 7feb7657aa7a7bf5aef3414a5084875f27192415 + updated_on: 2006-07-19 19:33:19 +02:00 + admin: false + mail: dlopper@somenet.foo + lastname: Lopper + firstname: Dave + id: 3 + auth_source_id: + mail_notification: true + login: dlopper diff --git a/test/fixtures/versions.yml b/test/fixtures/versions.yml new file mode 100644 index 000000000..89a738abd --- /dev/null +++ b/test/fixtures/versions.yml @@ -0,0 +1,17 @@ +--- +versions_001: + created_on: 2006-07-19 21:00:07 +02:00 + name: "0.1" + project_id: 1 + updated_on: 2006-07-19 21:00:07 +02:00 + id: 1 + description: Beta + effective_date: 2006-07-01 +versions_002: + created_on: 2006-07-19 21:00:33 +02:00 + name: "1.0" + project_id: 1 + updated_on: 2006-07-19 21:00:33 +02:00 + id: 2 + description: Stable release + effective_date: 2006-07-19 diff --git a/test/fixtures/workflows.yml b/test/fixtures/workflows.yml new file mode 100644 index 000000000..47e95e6e3 --- /dev/null +++ b/test/fixtures/workflows.yml @@ -0,0 +1,1621 @@ +--- +workflows_189: + new_status_id: 5 + role_id: 1 + old_status_id: 2 + id: 189 + tracker_id: 3 +workflows_001: + new_status_id: 2 + role_id: 1 + old_status_id: 1 + id: 1 + tracker_id: 1 +workflows_002: + new_status_id: 3 + role_id: 1 + old_status_id: 1 + id: 2 + tracker_id: 1 +workflows_003: + new_status_id: 4 + role_id: 1 + old_status_id: 1 + id: 3 + tracker_id: 1 +workflows_110: + new_status_id: 6 + role_id: 1 + old_status_id: 4 + id: 110 + tracker_id: 2 +workflows_004: + new_status_id: 5 + role_id: 1 + old_status_id: 1 + id: 4 + tracker_id: 1 +workflows_030: + new_status_id: 5 + role_id: 1 + old_status_id: 6 + id: 30 + tracker_id: 1 +workflows_111: + new_status_id: 1 + role_id: 1 + old_status_id: 5 + id: 111 + tracker_id: 2 +workflows_005: + new_status_id: 6 + role_id: 1 + old_status_id: 1 + id: 5 + tracker_id: 1 +workflows_031: + new_status_id: 2 + role_id: 2 + old_status_id: 1 + id: 31 + tracker_id: 1 +workflows_112: + new_status_id: 2 + role_id: 1 + old_status_id: 5 + id: 112 + tracker_id: 2 +workflows_006: + new_status_id: 1 + role_id: 1 + old_status_id: 2 + id: 6 + tracker_id: 1 +workflows_032: + new_status_id: 3 + role_id: 2 + old_status_id: 1 + id: 32 + tracker_id: 1 +workflows_113: + new_status_id: 3 + role_id: 1 + old_status_id: 5 + id: 113 + tracker_id: 2 +workflows_220: + new_status_id: 6 + role_id: 2 + old_status_id: 2 + id: 220 + tracker_id: 3 +workflows_007: + new_status_id: 3 + role_id: 1 + old_status_id: 2 + id: 7 + tracker_id: 1 +workflows_033: + new_status_id: 4 + role_id: 2 + old_status_id: 1 + id: 33 + tracker_id: 1 +workflows_060: + new_status_id: 5 + role_id: 2 + old_status_id: 6 + id: 60 + tracker_id: 1 +workflows_114: + new_status_id: 4 + role_id: 1 + old_status_id: 5 + id: 114 + tracker_id: 2 +workflows_140: + new_status_id: 6 + role_id: 2 + old_status_id: 4 + id: 140 + tracker_id: 2 +workflows_221: + new_status_id: 1 + role_id: 2 + old_status_id: 3 + id: 221 + tracker_id: 3 +workflows_008: + new_status_id: 4 + role_id: 1 + old_status_id: 2 + id: 8 + tracker_id: 1 +workflows_034: + new_status_id: 5 + role_id: 2 + old_status_id: 1 + id: 34 + tracker_id: 1 +workflows_115: + new_status_id: 6 + role_id: 1 + old_status_id: 5 + id: 115 + tracker_id: 2 +workflows_141: + new_status_id: 1 + role_id: 2 + old_status_id: 5 + id: 141 + tracker_id: 2 +workflows_222: + new_status_id: 2 + role_id: 2 + old_status_id: 3 + id: 222 + tracker_id: 3 +workflows_223: + new_status_id: 4 + role_id: 2 + old_status_id: 3 + id: 223 + tracker_id: 3 +workflows_009: + new_status_id: 5 + role_id: 1 + old_status_id: 2 + id: 9 + tracker_id: 1 +workflows_035: + new_status_id: 6 + role_id: 2 + old_status_id: 1 + id: 35 + tracker_id: 1 +workflows_061: + new_status_id: 2 + role_id: 3 + old_status_id: 1 + id: 61 + tracker_id: 1 +workflows_116: + new_status_id: 1 + role_id: 1 + old_status_id: 6 + id: 116 + tracker_id: 2 +workflows_142: + new_status_id: 2 + role_id: 2 + old_status_id: 5 + id: 142 + tracker_id: 2 +workflows_250: + new_status_id: 6 + role_id: 3 + old_status_id: 2 + id: 250 + tracker_id: 3 +workflows_224: + new_status_id: 5 + role_id: 2 + old_status_id: 3 + id: 224 + tracker_id: 3 +workflows_036: + new_status_id: 1 + role_id: 2 + old_status_id: 2 + id: 36 + tracker_id: 1 +workflows_062: + new_status_id: 3 + role_id: 3 + old_status_id: 1 + id: 62 + tracker_id: 1 +workflows_117: + new_status_id: 2 + role_id: 1 + old_status_id: 6 + id: 117 + tracker_id: 2 +workflows_143: + new_status_id: 3 + role_id: 2 + old_status_id: 5 + id: 143 + tracker_id: 2 +workflows_170: + new_status_id: 6 + role_id: 3 + old_status_id: 4 + id: 170 + tracker_id: 2 +workflows_251: + new_status_id: 1 + role_id: 3 + old_status_id: 3 + id: 251 + tracker_id: 3 +workflows_225: + new_status_id: 6 + role_id: 2 + old_status_id: 3 + id: 225 + tracker_id: 3 +workflows_037: + new_status_id: 3 + role_id: 2 + old_status_id: 2 + id: 37 + tracker_id: 1 +workflows_063: + new_status_id: 4 + role_id: 3 + old_status_id: 1 + id: 63 + tracker_id: 1 +workflows_090: + new_status_id: 5 + role_id: 3 + old_status_id: 6 + id: 90 + tracker_id: 1 +workflows_118: + new_status_id: 3 + role_id: 1 + old_status_id: 6 + id: 118 + tracker_id: 2 +workflows_144: + new_status_id: 4 + role_id: 2 + old_status_id: 5 + id: 144 + tracker_id: 2 +workflows_252: + new_status_id: 2 + role_id: 3 + old_status_id: 3 + id: 252 + tracker_id: 3 +workflows_226: + new_status_id: 1 + role_id: 2 + old_status_id: 4 + id: 226 + tracker_id: 3 +workflows_038: + new_status_id: 4 + role_id: 2 + old_status_id: 2 + id: 38 + tracker_id: 1 +workflows_064: + new_status_id: 5 + role_id: 3 + old_status_id: 1 + id: 64 + tracker_id: 1 +workflows_091: + new_status_id: 2 + role_id: 1 + old_status_id: 1 + id: 91 + tracker_id: 2 +workflows_119: + new_status_id: 4 + role_id: 1 + old_status_id: 6 + id: 119 + tracker_id: 2 +workflows_145: + new_status_id: 6 + role_id: 2 + old_status_id: 5 + id: 145 + tracker_id: 2 +workflows_171: + new_status_id: 1 + role_id: 3 + old_status_id: 5 + id: 171 + tracker_id: 2 +workflows_253: + new_status_id: 4 + role_id: 3 + old_status_id: 3 + id: 253 + tracker_id: 3 +workflows_227: + new_status_id: 2 + role_id: 2 + old_status_id: 4 + id: 227 + tracker_id: 3 +workflows_039: + new_status_id: 5 + role_id: 2 + old_status_id: 2 + id: 39 + tracker_id: 1 +workflows_065: + new_status_id: 6 + role_id: 3 + old_status_id: 1 + id: 65 + tracker_id: 1 +workflows_092: + new_status_id: 3 + role_id: 1 + old_status_id: 1 + id: 92 + tracker_id: 2 +workflows_146: + new_status_id: 1 + role_id: 2 + old_status_id: 6 + id: 146 + tracker_id: 2 +workflows_172: + new_status_id: 2 + role_id: 3 + old_status_id: 5 + id: 172 + tracker_id: 2 +workflows_254: + new_status_id: 5 + role_id: 3 + old_status_id: 3 + id: 254 + tracker_id: 3 +workflows_228: + new_status_id: 3 + role_id: 2 + old_status_id: 4 + id: 228 + tracker_id: 3 +workflows_066: + new_status_id: 1 + role_id: 3 + old_status_id: 2 + id: 66 + tracker_id: 1 +workflows_093: + new_status_id: 4 + role_id: 1 + old_status_id: 1 + id: 93 + tracker_id: 2 +workflows_147: + new_status_id: 2 + role_id: 2 + old_status_id: 6 + id: 147 + tracker_id: 2 +workflows_173: + new_status_id: 3 + role_id: 3 + old_status_id: 5 + id: 173 + tracker_id: 2 +workflows_255: + new_status_id: 6 + role_id: 3 + old_status_id: 3 + id: 255 + tracker_id: 3 +workflows_229: + new_status_id: 5 + role_id: 2 + old_status_id: 4 + id: 229 + tracker_id: 3 +workflows_067: + new_status_id: 3 + role_id: 3 + old_status_id: 2 + id: 67 + tracker_id: 1 +workflows_148: + new_status_id: 3 + role_id: 2 + old_status_id: 6 + id: 148 + tracker_id: 2 +workflows_174: + new_status_id: 4 + role_id: 3 + old_status_id: 5 + id: 174 + tracker_id: 2 +workflows_256: + new_status_id: 1 + role_id: 3 + old_status_id: 4 + id: 256 + tracker_id: 3 +workflows_068: + new_status_id: 4 + role_id: 3 + old_status_id: 2 + id: 68 + tracker_id: 1 +workflows_094: + new_status_id: 5 + role_id: 1 + old_status_id: 1 + id: 94 + tracker_id: 2 +workflows_149: + new_status_id: 4 + role_id: 2 + old_status_id: 6 + id: 149 + tracker_id: 2 +workflows_175: + new_status_id: 6 + role_id: 3 + old_status_id: 5 + id: 175 + tracker_id: 2 +workflows_257: + new_status_id: 2 + role_id: 3 + old_status_id: 4 + id: 257 + tracker_id: 3 +workflows_069: + new_status_id: 5 + role_id: 3 + old_status_id: 2 + id: 69 + tracker_id: 1 +workflows_095: + new_status_id: 6 + role_id: 1 + old_status_id: 1 + id: 95 + tracker_id: 2 +workflows_176: + new_status_id: 1 + role_id: 3 + old_status_id: 6 + id: 176 + tracker_id: 2 +workflows_258: + new_status_id: 3 + role_id: 3 + old_status_id: 4 + id: 258 + tracker_id: 3 +workflows_096: + new_status_id: 1 + role_id: 1 + old_status_id: 2 + id: 96 + tracker_id: 2 +workflows_177: + new_status_id: 2 + role_id: 3 + old_status_id: 6 + id: 177 + tracker_id: 2 +workflows_259: + new_status_id: 5 + role_id: 3 + old_status_id: 4 + id: 259 + tracker_id: 3 +workflows_097: + new_status_id: 3 + role_id: 1 + old_status_id: 2 + id: 97 + tracker_id: 2 +workflows_178: + new_status_id: 3 + role_id: 3 + old_status_id: 6 + id: 178 + tracker_id: 2 +workflows_098: + new_status_id: 4 + role_id: 1 + old_status_id: 2 + id: 98 + tracker_id: 2 +workflows_179: + new_status_id: 4 + role_id: 3 + old_status_id: 6 + id: 179 + tracker_id: 2 +workflows_099: + new_status_id: 5 + role_id: 1 + old_status_id: 2 + id: 99 + tracker_id: 2 +workflows_100: + new_status_id: 6 + role_id: 1 + old_status_id: 2 + id: 100 + tracker_id: 2 +workflows_020: + new_status_id: 6 + role_id: 1 + old_status_id: 4 + id: 20 + tracker_id: 1 +workflows_101: + new_status_id: 1 + role_id: 1 + old_status_id: 3 + id: 101 + tracker_id: 2 +workflows_021: + new_status_id: 1 + role_id: 1 + old_status_id: 5 + id: 21 + tracker_id: 1 +workflows_102: + new_status_id: 2 + role_id: 1 + old_status_id: 3 + id: 102 + tracker_id: 2 +workflows_210: + new_status_id: 5 + role_id: 1 + old_status_id: 6 + id: 210 + tracker_id: 3 +workflows_022: + new_status_id: 2 + role_id: 1 + old_status_id: 5 + id: 22 + tracker_id: 1 +workflows_103: + new_status_id: 4 + role_id: 1 + old_status_id: 3 + id: 103 + tracker_id: 2 +workflows_023: + new_status_id: 3 + role_id: 1 + old_status_id: 5 + id: 23 + tracker_id: 1 +workflows_104: + new_status_id: 5 + role_id: 1 + old_status_id: 3 + id: 104 + tracker_id: 2 +workflows_130: + new_status_id: 6 + role_id: 2 + old_status_id: 2 + id: 130 + tracker_id: 2 +workflows_211: + new_status_id: 2 + role_id: 2 + old_status_id: 1 + id: 211 + tracker_id: 3 +workflows_024: + new_status_id: 4 + role_id: 1 + old_status_id: 5 + id: 24 + tracker_id: 1 +workflows_050: + new_status_id: 6 + role_id: 2 + old_status_id: 4 + id: 50 + tracker_id: 1 +workflows_105: + new_status_id: 6 + role_id: 1 + old_status_id: 3 + id: 105 + tracker_id: 2 +workflows_131: + new_status_id: 1 + role_id: 2 + old_status_id: 3 + id: 131 + tracker_id: 2 +workflows_212: + new_status_id: 3 + role_id: 2 + old_status_id: 1 + id: 212 + tracker_id: 3 +workflows_025: + new_status_id: 6 + role_id: 1 + old_status_id: 5 + id: 25 + tracker_id: 1 +workflows_051: + new_status_id: 1 + role_id: 2 + old_status_id: 5 + id: 51 + tracker_id: 1 +workflows_106: + new_status_id: 1 + role_id: 1 + old_status_id: 4 + id: 106 + tracker_id: 2 +workflows_132: + new_status_id: 2 + role_id: 2 + old_status_id: 3 + id: 132 + tracker_id: 2 +workflows_213: + new_status_id: 4 + role_id: 2 + old_status_id: 1 + id: 213 + tracker_id: 3 +workflows_240: + new_status_id: 5 + role_id: 2 + old_status_id: 6 + id: 240 + tracker_id: 3 +workflows_026: + new_status_id: 1 + role_id: 1 + old_status_id: 6 + id: 26 + tracker_id: 1 +workflows_052: + new_status_id: 2 + role_id: 2 + old_status_id: 5 + id: 52 + tracker_id: 1 +workflows_107: + new_status_id: 2 + role_id: 1 + old_status_id: 4 + id: 107 + tracker_id: 2 +workflows_133: + new_status_id: 4 + role_id: 2 + old_status_id: 3 + id: 133 + tracker_id: 2 +workflows_214: + new_status_id: 5 + role_id: 2 + old_status_id: 1 + id: 214 + tracker_id: 3 +workflows_241: + new_status_id: 2 + role_id: 3 + old_status_id: 1 + id: 241 + tracker_id: 3 +workflows_027: + new_status_id: 2 + role_id: 1 + old_status_id: 6 + id: 27 + tracker_id: 1 +workflows_053: + new_status_id: 3 + role_id: 2 + old_status_id: 5 + id: 53 + tracker_id: 1 +workflows_080: + new_status_id: 6 + role_id: 3 + old_status_id: 4 + id: 80 + tracker_id: 1 +workflows_108: + new_status_id: 3 + role_id: 1 + old_status_id: 4 + id: 108 + tracker_id: 2 +workflows_134: + new_status_id: 5 + role_id: 2 + old_status_id: 3 + id: 134 + tracker_id: 2 +workflows_160: + new_status_id: 6 + role_id: 3 + old_status_id: 2 + id: 160 + tracker_id: 2 +workflows_215: + new_status_id: 6 + role_id: 2 + old_status_id: 1 + id: 215 + tracker_id: 3 +workflows_242: + new_status_id: 3 + role_id: 3 + old_status_id: 1 + id: 242 + tracker_id: 3 +workflows_028: + new_status_id: 3 + role_id: 1 + old_status_id: 6 + id: 28 + tracker_id: 1 +workflows_054: + new_status_id: 4 + role_id: 2 + old_status_id: 5 + id: 54 + tracker_id: 1 +workflows_081: + new_status_id: 1 + role_id: 3 + old_status_id: 5 + id: 81 + tracker_id: 1 +workflows_109: + new_status_id: 5 + role_id: 1 + old_status_id: 4 + id: 109 + tracker_id: 2 +workflows_135: + new_status_id: 6 + role_id: 2 + old_status_id: 3 + id: 135 + tracker_id: 2 +workflows_161: + new_status_id: 1 + role_id: 3 + old_status_id: 3 + id: 161 + tracker_id: 2 +workflows_216: + new_status_id: 1 + role_id: 2 + old_status_id: 2 + id: 216 + tracker_id: 3 +workflows_243: + new_status_id: 4 + role_id: 3 + old_status_id: 1 + id: 243 + tracker_id: 3 +workflows_029: + new_status_id: 4 + role_id: 1 + old_status_id: 6 + id: 29 + tracker_id: 1 +workflows_055: + new_status_id: 6 + role_id: 2 + old_status_id: 5 + id: 55 + tracker_id: 1 +workflows_082: + new_status_id: 2 + role_id: 3 + old_status_id: 5 + id: 82 + tracker_id: 1 +workflows_136: + new_status_id: 1 + role_id: 2 + old_status_id: 4 + id: 136 + tracker_id: 2 +workflows_162: + new_status_id: 2 + role_id: 3 + old_status_id: 3 + id: 162 + tracker_id: 2 +workflows_217: + new_status_id: 3 + role_id: 2 + old_status_id: 2 + id: 217 + tracker_id: 3 +workflows_270: + new_status_id: 5 + role_id: 3 + old_status_id: 6 + id: 270 + tracker_id: 3 +workflows_244: + new_status_id: 5 + role_id: 3 + old_status_id: 1 + id: 244 + tracker_id: 3 +workflows_056: + new_status_id: 1 + role_id: 2 + old_status_id: 6 + id: 56 + tracker_id: 1 +workflows_137: + new_status_id: 2 + role_id: 2 + old_status_id: 4 + id: 137 + tracker_id: 2 +workflows_163: + new_status_id: 4 + role_id: 3 + old_status_id: 3 + id: 163 + tracker_id: 2 +workflows_190: + new_status_id: 6 + role_id: 1 + old_status_id: 2 + id: 190 + tracker_id: 3 +workflows_218: + new_status_id: 4 + role_id: 2 + old_status_id: 2 + id: 218 + tracker_id: 3 +workflows_245: + new_status_id: 6 + role_id: 3 + old_status_id: 1 + id: 245 + tracker_id: 3 +workflows_057: + new_status_id: 2 + role_id: 2 + old_status_id: 6 + id: 57 + tracker_id: 1 +workflows_083: + new_status_id: 3 + role_id: 3 + old_status_id: 5 + id: 83 + tracker_id: 1 +workflows_138: + new_status_id: 3 + role_id: 2 + old_status_id: 4 + id: 138 + tracker_id: 2 +workflows_164: + new_status_id: 5 + role_id: 3 + old_status_id: 3 + id: 164 + tracker_id: 2 +workflows_191: + new_status_id: 1 + role_id: 1 + old_status_id: 3 + id: 191 + tracker_id: 3 +workflows_219: + new_status_id: 5 + role_id: 2 + old_status_id: 2 + id: 219 + tracker_id: 3 +workflows_246: + new_status_id: 1 + role_id: 3 + old_status_id: 2 + id: 246 + tracker_id: 3 +workflows_058: + new_status_id: 3 + role_id: 2 + old_status_id: 6 + id: 58 + tracker_id: 1 +workflows_084: + new_status_id: 4 + role_id: 3 + old_status_id: 5 + id: 84 + tracker_id: 1 +workflows_139: + new_status_id: 5 + role_id: 2 + old_status_id: 4 + id: 139 + tracker_id: 2 +workflows_165: + new_status_id: 6 + role_id: 3 + old_status_id: 3 + id: 165 + tracker_id: 2 +workflows_192: + new_status_id: 2 + role_id: 1 + old_status_id: 3 + id: 192 + tracker_id: 3 +workflows_247: + new_status_id: 3 + role_id: 3 + old_status_id: 2 + id: 247 + tracker_id: 3 +workflows_059: + new_status_id: 4 + role_id: 2 + old_status_id: 6 + id: 59 + tracker_id: 1 +workflows_085: + new_status_id: 6 + role_id: 3 + old_status_id: 5 + id: 85 + tracker_id: 1 +workflows_166: + new_status_id: 1 + role_id: 3 + old_status_id: 4 + id: 166 + tracker_id: 2 +workflows_248: + new_status_id: 4 + role_id: 3 + old_status_id: 2 + id: 248 + tracker_id: 3 +workflows_086: + new_status_id: 1 + role_id: 3 + old_status_id: 6 + id: 86 + tracker_id: 1 +workflows_167: + new_status_id: 2 + role_id: 3 + old_status_id: 4 + id: 167 + tracker_id: 2 +workflows_193: + new_status_id: 4 + role_id: 1 + old_status_id: 3 + id: 193 + tracker_id: 3 +workflows_249: + new_status_id: 5 + role_id: 3 + old_status_id: 2 + id: 249 + tracker_id: 3 +workflows_087: + new_status_id: 2 + role_id: 3 + old_status_id: 6 + id: 87 + tracker_id: 1 +workflows_168: + new_status_id: 3 + role_id: 3 + old_status_id: 4 + id: 168 + tracker_id: 2 +workflows_194: + new_status_id: 5 + role_id: 1 + old_status_id: 3 + id: 194 + tracker_id: 3 +workflows_088: + new_status_id: 3 + role_id: 3 + old_status_id: 6 + id: 88 + tracker_id: 1 +workflows_169: + new_status_id: 5 + role_id: 3 + old_status_id: 4 + id: 169 + tracker_id: 2 +workflows_195: + new_status_id: 6 + role_id: 1 + old_status_id: 3 + id: 195 + tracker_id: 3 +workflows_089: + new_status_id: 4 + role_id: 3 + old_status_id: 6 + id: 89 + tracker_id: 1 +workflows_196: + new_status_id: 1 + role_id: 1 + old_status_id: 4 + id: 196 + tracker_id: 3 +workflows_197: + new_status_id: 2 + role_id: 1 + old_status_id: 4 + id: 197 + tracker_id: 3 +workflows_198: + new_status_id: 3 + role_id: 1 + old_status_id: 4 + id: 198 + tracker_id: 3 +workflows_199: + new_status_id: 5 + role_id: 1 + old_status_id: 4 + id: 199 + tracker_id: 3 +workflows_010: + new_status_id: 6 + role_id: 1 + old_status_id: 2 + id: 10 + tracker_id: 1 +workflows_011: + new_status_id: 1 + role_id: 1 + old_status_id: 3 + id: 11 + tracker_id: 1 +workflows_012: + new_status_id: 2 + role_id: 1 + old_status_id: 3 + id: 12 + tracker_id: 1 +workflows_200: + new_status_id: 6 + role_id: 1 + old_status_id: 4 + id: 200 + tracker_id: 3 +workflows_013: + new_status_id: 4 + role_id: 1 + old_status_id: 3 + id: 13 + tracker_id: 1 +workflows_120: + new_status_id: 5 + role_id: 1 + old_status_id: 6 + id: 120 + tracker_id: 2 +workflows_201: + new_status_id: 1 + role_id: 1 + old_status_id: 5 + id: 201 + tracker_id: 3 +workflows_040: + new_status_id: 6 + role_id: 2 + old_status_id: 2 + id: 40 + tracker_id: 1 +workflows_121: + new_status_id: 2 + role_id: 2 + old_status_id: 1 + id: 121 + tracker_id: 2 +workflows_202: + new_status_id: 2 + role_id: 1 + old_status_id: 5 + id: 202 + tracker_id: 3 +workflows_014: + new_status_id: 5 + role_id: 1 + old_status_id: 3 + id: 14 + tracker_id: 1 +workflows_041: + new_status_id: 1 + role_id: 2 + old_status_id: 3 + id: 41 + tracker_id: 1 +workflows_122: + new_status_id: 3 + role_id: 2 + old_status_id: 1 + id: 122 + tracker_id: 2 +workflows_203: + new_status_id: 3 + role_id: 1 + old_status_id: 5 + id: 203 + tracker_id: 3 +workflows_015: + new_status_id: 6 + role_id: 1 + old_status_id: 3 + id: 15 + tracker_id: 1 +workflows_230: + new_status_id: 6 + role_id: 2 + old_status_id: 4 + id: 230 + tracker_id: 3 +workflows_123: + new_status_id: 4 + role_id: 2 + old_status_id: 1 + id: 123 + tracker_id: 2 +workflows_204: + new_status_id: 4 + role_id: 1 + old_status_id: 5 + id: 204 + tracker_id: 3 +workflows_016: + new_status_id: 1 + role_id: 1 + old_status_id: 4 + id: 16 + tracker_id: 1 +workflows_042: + new_status_id: 2 + role_id: 2 + old_status_id: 3 + id: 42 + tracker_id: 1 +workflows_231: + new_status_id: 1 + role_id: 2 + old_status_id: 5 + id: 231 + tracker_id: 3 +workflows_070: + new_status_id: 6 + role_id: 3 + old_status_id: 2 + id: 70 + tracker_id: 1 +workflows_124: + new_status_id: 5 + role_id: 2 + old_status_id: 1 + id: 124 + tracker_id: 2 +workflows_150: + new_status_id: 5 + role_id: 2 + old_status_id: 6 + id: 150 + tracker_id: 2 +workflows_205: + new_status_id: 6 + role_id: 1 + old_status_id: 5 + id: 205 + tracker_id: 3 +workflows_017: + new_status_id: 2 + role_id: 1 + old_status_id: 4 + id: 17 + tracker_id: 1 +workflows_043: + new_status_id: 4 + role_id: 2 + old_status_id: 3 + id: 43 + tracker_id: 1 +workflows_232: + new_status_id: 2 + role_id: 2 + old_status_id: 5 + id: 232 + tracker_id: 3 +workflows_125: + new_status_id: 6 + role_id: 2 + old_status_id: 1 + id: 125 + tracker_id: 2 +workflows_151: + new_status_id: 2 + role_id: 3 + old_status_id: 1 + id: 151 + tracker_id: 2 +workflows_206: + new_status_id: 1 + role_id: 1 + old_status_id: 6 + id: 206 + tracker_id: 3 +workflows_018: + new_status_id: 3 + role_id: 1 + old_status_id: 4 + id: 18 + tracker_id: 1 +workflows_044: + new_status_id: 5 + role_id: 2 + old_status_id: 3 + id: 44 + tracker_id: 1 +workflows_071: + new_status_id: 1 + role_id: 3 + old_status_id: 3 + id: 71 + tracker_id: 1 +workflows_233: + new_status_id: 3 + role_id: 2 + old_status_id: 5 + id: 233 + tracker_id: 3 +workflows_126: + new_status_id: 1 + role_id: 2 + old_status_id: 2 + id: 126 + tracker_id: 2 +workflows_152: + new_status_id: 3 + role_id: 3 + old_status_id: 1 + id: 152 + tracker_id: 2 +workflows_207: + new_status_id: 2 + role_id: 1 + old_status_id: 6 + id: 207 + tracker_id: 3 +workflows_019: + new_status_id: 5 + role_id: 1 + old_status_id: 4 + id: 19 + tracker_id: 1 +workflows_045: + new_status_id: 6 + role_id: 2 + old_status_id: 3 + id: 45 + tracker_id: 1 +workflows_260: + new_status_id: 6 + role_id: 3 + old_status_id: 4 + id: 260 + tracker_id: 3 +workflows_234: + new_status_id: 4 + role_id: 2 + old_status_id: 5 + id: 234 + tracker_id: 3 +workflows_127: + new_status_id: 3 + role_id: 2 + old_status_id: 2 + id: 127 + tracker_id: 2 +workflows_153: + new_status_id: 4 + role_id: 3 + old_status_id: 1 + id: 153 + tracker_id: 2 +workflows_180: + new_status_id: 5 + role_id: 3 + old_status_id: 6 + id: 180 + tracker_id: 2 +workflows_208: + new_status_id: 3 + role_id: 1 + old_status_id: 6 + id: 208 + tracker_id: 3 +workflows_046: + new_status_id: 1 + role_id: 2 + old_status_id: 4 + id: 46 + tracker_id: 1 +workflows_072: + new_status_id: 2 + role_id: 3 + old_status_id: 3 + id: 72 + tracker_id: 1 +workflows_261: + new_status_id: 1 + role_id: 3 + old_status_id: 5 + id: 261 + tracker_id: 3 +workflows_235: + new_status_id: 6 + role_id: 2 + old_status_id: 5 + id: 235 + tracker_id: 3 +workflows_154: + new_status_id: 5 + role_id: 3 + old_status_id: 1 + id: 154 + tracker_id: 2 +workflows_181: + new_status_id: 2 + role_id: 1 + old_status_id: 1 + id: 181 + tracker_id: 3 +workflows_209: + new_status_id: 4 + role_id: 1 + old_status_id: 6 + id: 209 + tracker_id: 3 +workflows_047: + new_status_id: 2 + role_id: 2 + old_status_id: 4 + id: 47 + tracker_id: 1 +workflows_073: + new_status_id: 4 + role_id: 3 + old_status_id: 3 + id: 73 + tracker_id: 1 +workflows_128: + new_status_id: 4 + role_id: 2 + old_status_id: 2 + id: 128 + tracker_id: 2 +workflows_262: + new_status_id: 2 + role_id: 3 + old_status_id: 5 + id: 262 + tracker_id: 3 +workflows_236: + new_status_id: 1 + role_id: 2 + old_status_id: 6 + id: 236 + tracker_id: 3 +workflows_155: + new_status_id: 6 + role_id: 3 + old_status_id: 1 + id: 155 + tracker_id: 2 +workflows_048: + new_status_id: 3 + role_id: 2 + old_status_id: 4 + id: 48 + tracker_id: 1 +workflows_074: + new_status_id: 5 + role_id: 3 + old_status_id: 3 + id: 74 + tracker_id: 1 +workflows_129: + new_status_id: 5 + role_id: 2 + old_status_id: 2 + id: 129 + tracker_id: 2 +workflows_263: + new_status_id: 3 + role_id: 3 + old_status_id: 5 + id: 263 + tracker_id: 3 +workflows_237: + new_status_id: 2 + role_id: 2 + old_status_id: 6 + id: 237 + tracker_id: 3 +workflows_182: + new_status_id: 3 + role_id: 1 + old_status_id: 1 + id: 182 + tracker_id: 3 +workflows_049: + new_status_id: 5 + role_id: 2 + old_status_id: 4 + id: 49 + tracker_id: 1 +workflows_075: + new_status_id: 6 + role_id: 3 + old_status_id: 3 + id: 75 + tracker_id: 1 +workflows_156: + new_status_id: 1 + role_id: 3 + old_status_id: 2 + id: 156 + tracker_id: 2 +workflows_264: + new_status_id: 4 + role_id: 3 + old_status_id: 5 + id: 264 + tracker_id: 3 +workflows_238: + new_status_id: 3 + role_id: 2 + old_status_id: 6 + id: 238 + tracker_id: 3 +workflows_183: + new_status_id: 4 + role_id: 1 + old_status_id: 1 + id: 183 + tracker_id: 3 +workflows_076: + new_status_id: 1 + role_id: 3 + old_status_id: 4 + id: 76 + tracker_id: 1 +workflows_157: + new_status_id: 3 + role_id: 3 + old_status_id: 2 + id: 157 + tracker_id: 2 +workflows_265: + new_status_id: 6 + role_id: 3 + old_status_id: 5 + id: 265 + tracker_id: 3 +workflows_239: + new_status_id: 4 + role_id: 2 + old_status_id: 6 + id: 239 + tracker_id: 3 +workflows_077: + new_status_id: 2 + role_id: 3 + old_status_id: 4 + id: 77 + tracker_id: 1 +workflows_158: + new_status_id: 4 + role_id: 3 + old_status_id: 2 + id: 158 + tracker_id: 2 +workflows_184: + new_status_id: 5 + role_id: 1 + old_status_id: 1 + id: 184 + tracker_id: 3 +workflows_266: + new_status_id: 1 + role_id: 3 + old_status_id: 6 + id: 266 + tracker_id: 3 +workflows_078: + new_status_id: 3 + role_id: 3 + old_status_id: 4 + id: 78 + tracker_id: 1 +workflows_159: + new_status_id: 5 + role_id: 3 + old_status_id: 2 + id: 159 + tracker_id: 2 +workflows_185: + new_status_id: 6 + role_id: 1 + old_status_id: 1 + id: 185 + tracker_id: 3 +workflows_267: + new_status_id: 2 + role_id: 3 + old_status_id: 6 + id: 267 + tracker_id: 3 +workflows_079: + new_status_id: 5 + role_id: 3 + old_status_id: 4 + id: 79 + tracker_id: 1 +workflows_186: + new_status_id: 1 + role_id: 1 + old_status_id: 2 + id: 186 + tracker_id: 3 +workflows_268: + new_status_id: 3 + role_id: 3 + old_status_id: 6 + id: 268 + tracker_id: 3 +workflows_187: + new_status_id: 3 + role_id: 1 + old_status_id: 2 + id: 187 + tracker_id: 3 +workflows_269: + new_status_id: 4 + role_id: 3 + old_status_id: 6 + id: 269 + tracker_id: 3 +workflows_188: + new_status_id: 4 + role_id: 1 + old_status_id: 2 + id: 188 + tracker_id: 3 diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb new file mode 100644 index 000000000..525c71b45 --- /dev/null +++ b/test/functional/my_controller_test.rb @@ -0,0 +1,18 @@ +require File.dirname(__FILE__) + '/../test_helper' +require 'my_controller' + +# Re-raise errors caught by the controller. +class MyController; def rescue_action(e) raise e end; end + +class MyControllerTest < Test::Unit::TestCase + def setup + @controller = MyController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + # Replace this with your real tests. + def test_truth + assert true + end +end diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb new file mode 100644 index 000000000..f20f8ad0f --- /dev/null +++ b/test/functional/projects_controller_test.rb @@ -0,0 +1,114 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' +require 'projects_controller' + +# Re-raise errors caught by the controller. +class ProjectsController; def rescue_action(e) raise e end; end + +class ProjectsControllerTest < Test::Unit::TestCase + fixtures :projects, :permissions + + def setup + @controller = ProjectsController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + def test_index + get :index + assert_response :success + assert_template 'list' + end + + def test_list + get :list + assert_response :success + assert_template 'list' + assert_not_nil assigns(:projects) + end + + def test_show + get :show, :id => 1 + assert_response :success + assert_template 'show' + assert_not_nil assigns(:project) + end + + def test_list_members + get :list_members, :id => 1 + assert_response :success + assert_template 'list_members' + assert_not_nil assigns(:members) + end + + def test_list_documents + get :list_documents, :id => 1 + assert_response :success + assert_template 'list_documents' + assert_not_nil assigns(:documents) + end + + def test_list_issues + get :list_issues, :id => 1 + assert_response :success + assert_template 'list_issues' + assert_not_nil assigns(:issues) + end + + def test_list_issues_with_filter + get :list_issues, :id => 1, :set_filter => 1 + assert_response :success + assert_template 'list_issues' + assert_not_nil assigns(:issues) + end + + def test_list_issues_reset_filter + post :list_issues, :id => 1 + assert_response :success + assert_template 'list_issues' + assert_not_nil assigns(:issues) + end + + def test_export_issues_csv + get :export_issues_csv, :id => 1 + assert_response :success + assert_not_nil assigns(:issues) + end + + def test_list_news + get :list_news, :id => 1 + assert_response :success + assert_template 'list_news' + assert_not_nil assigns(:news) + end + + def test_list_files + get :list_files, :id => 1 + assert_response :success + assert_template 'list_files' + assert_not_nil assigns(:versions) + end + + def test_changelog + get :changelog, :id => 1 + assert_response :success + assert_template 'changelog' + assert_not_nil assigns(:fixed_issues) + end +end diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb new file mode 100644 index 000000000..0d6f75d70 --- /dev/null +++ b/test/integration/account_test.rb @@ -0,0 +1,100 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require "#{File.dirname(__FILE__)}/../test_helper" + +class AccountTest < ActionController::IntegrationTest + fixtures :users + + # Replace this with your real tests. + def test_login + get "my/page" + assert_redirected_to "account/login" + log_user('jsmith', 'jsmith') + + get "my/account" + assert_response :success + assert_template "my/account" + end + + def test_change_password + log_user('jsmith', 'jsmith') + get "my/account" + assert_response :success + assert_template "my/account" + + post "my/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello2" + assert_response :success + assert_template "my/account" + assert_tag :tag => "div", :attributes => { :class => "errorExplanation" } + + post "my/change_password", :password => 'jsmithZZ', :new_password => "hello", :new_password_confirmation => "hello" + assert_redirected_to "my/account" + assert_equal 'Wrong password', flash[:notice] + + post "my/change_password", :password => 'jsmith', :new_password => "hello", :new_password_confirmation => "hello" + assert_redirected_to "my/account" + log_user('jsmith', 'hello') + end + + def test_my_account + log_user('jsmith', 'jsmith') + get "my/account" + assert_response :success + assert_template "my/account" + + post "my/account", :user => {:firstname => "Joe", :login => "root", :admin => 1} + assert_response :success + assert_template "my/account" + user = User.find(2) + assert_equal "Joe", user.firstname + assert_equal "jsmith", user.login + assert_equal false, user.admin? + end + + def test_my_page + log_user('jsmith', 'jsmith') + get "my/page" + assert_response :success + assert_template "my/page" + end + + def test_lost_password + get "account/lost_password" + assert_response :success + assert_template "account/lost_password" + + post "account/lost_password", :mail => 'jsmith@somenet.foo' + assert_redirected_to "account/login" + + token = Token.find(:first) + assert_equal 'recovery', token.action + assert_equal 'jsmith@somenet.foo', token.user.mail + assert !token.expired? + + get "account/lost_password", :token => token.value + assert_response :success + assert_template "account/password_recovery" + + post "account/lost_password", :token => token.value, :new_password => 'newpass', :new_password_confirmation => 'newpass' + assert_redirected_to "account/login" + assert_equal 'Password was successfully updated.', flash[:notice] + + log_user('jsmith', 'newpass') + assert_equal 0, Token.count + end +end diff --git a/test/integration/admin_test.rb b/test/integration/admin_test.rb new file mode 100644 index 000000000..0241ae8da --- /dev/null +++ b/test/integration/admin_test.rb @@ -0,0 +1,61 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require "#{File.dirname(__FILE__)}/../test_helper" + +class AdminTest < ActionController::IntegrationTest + fixtures :users + + def test_add_user + log_user("admin", "admin") + get "/users/add" + assert_response :success + assert_template "users/add" + post "/users/add", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09" + assert_redirected_to "users/list" + + user = User.find_by_login("psmith") + assert_kind_of User, user + logged_user = User.try_to_login("psmith", "psmith09") + assert_kind_of User, logged_user + assert_equal "Paul", logged_user.firstname + + post "users/edit", :id => user.id, :user => { :status => User::STATUS_LOCKED } + assert_redirected_to "users/list" + locked_user = User.try_to_login("psmith", "psmith09") + assert_equal nil, locked_user + end + + def test_add_project + log_user("admin", "admin") + get "projects/add" + assert_response :success + assert_template "projects/add" + post "projects/add", :project => { :name => "blog", :description => "weblog", :is_public => 1} + assert_redirected_to "admin/projects" + assert_equal 'Successful creation.', flash[:notice] + + project = Project.find_by_name("blog") + assert_kind_of Project, project + assert_equal "weblog", project.description + assert_equal true, project.is_public? + + get "admin/projects" + assert_response :success + assert_template "admin/projects" + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 000000000..2e4f7dcd0 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,55 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +ENV["RAILS_ENV"] ||= "test" +require File.expand_path(File.dirname(__FILE__) + "/../config/environment") +require 'test_help' + +class Test::Unit::TestCase + # Transactional fixtures accelerate your tests by wrapping each test method + # in a transaction that's rolled back on completion. This ensures that the + # test database remains unchanged so your fixtures don't have to be reloaded + # between every test method. Fewer database queries means faster tests. + # + # Read Mike Clark's excellent walkthrough at + # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting + # + # Every Active Record database supports transactions except MyISAM tables + # in MySQL. Turn off transactional fixtures in this case; however, if you + # don't care one way or the other, switching from MyISAM to InnoDB tables + # is recommended. + self.use_transactional_fixtures = true + + # Instantiated fixtures are slow, but give you @david where otherwise you + # would need people(:david). If you don't want to migrate your existing + # test cases which use the @david style and don't mind the speed hit (each + # instantiated fixtures translates to a database query per test method), + # then set this back to true. + self.use_instantiated_fixtures = false + + # Add more helper methods to be used by all tests here... + + def log_user(login, password) + get "/account/login" + assert_equal nil, session[:user_id] + assert_response :success + assert_template "account/login" + post "/account/login", :login => login, :password => password + assert_redirected_to "my/page" + assert_equal login, User.find(session[:user_id]).login + end +end diff --git a/test/unit/member_test.rb b/test/unit/member_test.rb new file mode 100644 index 000000000..079782306 --- /dev/null +++ b/test/unit/member_test.rb @@ -0,0 +1,51 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' + +class MemberTest < Test::Unit::TestCase + fixtures :users, :projects, :roles, :members + + def setup + @jsmith = Member.find(1) + end + + def test_create + member = Member.new(:project_id => 1, :user_id => 4, :role_id => 1) + assert member.save + end + + def test_update + assert_equal "eCookbook", @jsmith.project.name + assert_equal "Manager", @jsmith.role.name + assert_equal "jsmith", @jsmith.user.login + + @jsmith.role = Role.find(2) + assert @jsmith.save + end + + def test_validate + member = Member.new(:project_id => 1, :user_id => 2, :role_id =>2) + # same use can't have more than one role for a project + assert !member.save + end + + def test_destroy + @jsmith.destroy + assert_raise(ActiveRecord::RecordNotFound) { Member.find(@jsmith.id) } + end +end diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb new file mode 100644 index 000000000..9c8f0c97e --- /dev/null +++ b/test/unit/project_test.rb @@ -0,0 +1,79 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' + +class ProjectTest < Test::Unit::TestCase + fixtures :projects + + def setup + @ecookbook = Project.find(1) + @ecookbook_sub1 = Project.find(3) + end + + def test_truth + assert_kind_of Project, @ecookbook + assert_equal "eCookbook", @ecookbook.name + end + + def test_update + assert_equal "eCookbook", @ecookbook.name + @ecookbook.name = "eCook" + assert @ecookbook.save, @ecookbook.errors.full_messages.join("; ") + @ecookbook.reload + assert_equal "eCook", @ecookbook.name + end + + def test_validate + @ecookbook.name = "" + assert !@ecookbook.save + assert_equal 1, @ecookbook.errors.count + assert_equal l(:activerecord_error_blank), @ecookbook.errors.on(:name) + end + + def test_public_projects + public_projects = Project.find(:all, :conditions => ["is_public=?", true]) + assert_equal 3, public_projects.length + assert_equal true, public_projects[0].is_public? + end + + def test_destroy + @ecookbook.destroy + assert_raise(ActiveRecord::RecordNotFound) { Project.find(@ecookbook.id) } + end + + def test_subproject_ok + sub = Project.find(2) + sub.parent = @ecookbook + assert sub.save + assert_equal @ecookbook.id, sub.parent.id + @ecookbook.reload + assert_equal 3, @ecookbook.projects_count + end + + def test_subproject_invalid + sub = Project.find(2) + sub.parent = @ecookbook_sub1 + assert !sub.save + end + + def test_subproject_invalid_2 + sub = @ecookbook + sub.parent = Project.find(2) + assert !sub.save + end +end diff --git a/test/unit/token_test.rb b/test/unit/token_test.rb new file mode 100644 index 000000000..1c3820e99 --- /dev/null +++ b/test/unit/token_test.rb @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class TokenTest < Test::Unit::TestCase + fixtures :tokens + + # Replace this with your real tests. + def test_truth + assert true + end +end diff --git a/test/unit/user_preference_test.rb b/test/unit/user_preference_test.rb new file mode 100644 index 000000000..4675a2652 --- /dev/null +++ b/test/unit/user_preference_test.rb @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class UserPreferenceTest < Test::Unit::TestCase + fixtures :user_preferences + + # Replace this with your real tests. + def test_truth + assert true + end +end diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb new file mode 100644 index 000000000..211e6554c --- /dev/null +++ b/test/unit/user_test.rb @@ -0,0 +1,88 @@ +# redMine - project management software +# Copyright (C) 2006 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' + +class UserTest < Test::Unit::TestCase + fixtures :users + + def setup + @admin = User.find(1) + @jsmith = User.find(2) + end + + def test_truth + assert_kind_of User, @jsmith + end + + def test_create + user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo") + + user.login = "jsmith" + user.password, user.password_confirmation = "password", "password" + # login uniqueness + assert !user.save + assert_equal 1, user.errors.count + + user.login = "newuser" + user.password, user.password_confirmation = "passwd", "password" + # password confirmation + assert !user.save + assert_equal 1, user.errors.count + + user.password, user.password_confirmation = "password", "password" + assert user.save + end + + def test_update + assert_equal "admin", @admin.login + @admin.login = "john" + assert @admin.save, @admin.errors.full_messages.join("; ") + @admin.reload + assert_equal "john", @admin.login + end + + def test_validate + @admin.login = "" + assert !@admin.save + assert_equal 2, @admin.errors.count + end + + def test_password + user = User.try_to_login("admin", "admin") + assert_kind_of User, user + assert_equal "admin", user.login + user.password = "hello" + assert user.save + + user = User.try_to_login("admin", "hello") + assert_kind_of User, user + assert_equal "admin", user.login + assert_equal User.hash_password("hello"), user.hashed_password + end + + def test_lock + user = User.try_to_login("jsmith", "jsmith") + assert_equal @jsmith, user + + @jsmith.status = User::STATUS_LOCKED + assert @jsmith.save + + user = User.try_to_login("jsmith", "jsmith") + assert_equal nil, user + end +end -- cgit v1.2.3