backlog 0.36.2 → 0.37.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +16 -4
- data/Gemfile.lock +130 -0
- data/History.txt +17 -0
- data/README.txt +0 -2
- data/Rakefile +17 -7
- data/app/controllers/absences_controller.rb +1 -2
- data/app/controllers/application_controller.rb +13 -14
- data/app/controllers/application_controller.rb.rails2 +186 -0
- data/app/controllers/estimates_controller.rb +1 -1
- data/app/controllers/groups_controller.rb +3 -1
- data/app/controllers/periods_controller.rb +61 -50
- data/app/controllers/{backlogs_controller.rb → projects_controller.rb} +35 -35
- data/app/controllers/search_controller.rb +2 -2
- data/app/controllers/tasks_controller.rb +11 -11
- data/app/controllers/user_controller.rb +6 -4
- data/app/controllers/welcome_controller.rb +4 -4
- data/app/controllers/work_locks_controller.rb +2 -2
- data/app/controllers/works_controller.rb +31 -31
- data/app/helpers/application_helper.rb +2 -2
- data/app/helpers/application_helper.rb.rails2 +118 -0
- data/app/helpers/periods_helper.rb +3 -3
- data/app/helpers/{backlogs_helper.rb → projects_helper.rb} +5 -5
- data/app/helpers/user_helper.rb +2 -2
- data/app/{models → mailers}/user_notify.rb +1 -0
- data/app/models/absence.rb +2 -2
- data/{lib → app/models}/clock.rb +0 -0
- data/app/models/estimate.rb +2 -2
- data/app/models/party.rb +1 -2
- data/app/models/period.rb +17 -18
- data/app/models/{backlog.rb → project.rb} +2 -2
- data/app/models/sidebar.rb +2 -2
- data/app/models/task.rb +28 -28
- data/app/models/user.rb +5 -4
- data/app/models/work.rb +29 -23
- data/app/models/work_lock_nagger.rb +1 -1
- data/app/models/works_report_filter.rb +4 -4
- data/app/views/customers/_name_list.rhtml +1 -1
- data/app/views/layouts/_headers.rhtml +2 -1
- data/app/views/layouts/_left_top.rhtml +32 -29
- data/app/views/layouts/_shortcuts.rhtml +15 -9
- data/app/views/layouts/_shortcuts_js.rhtml +4 -4
- data/app/views/layouts/mwrt002.html.erb +44 -0
- data/app/views/periods/_burn_down_chart.rhtml +1 -1
- data/app/views/periods/_show_active.rhtml +3 -3
- data/app/views/periods/_title.rhtml +1 -1
- data/app/views/{backlogs → projects}/_buttons.rhtml +4 -4
- data/app/views/projects/_form.rhtml +44 -0
- data/app/views/projects/_name_list.rhtml +5 -0
- data/app/views/projects/edit.rhtml +14 -0
- data/app/views/{backlogs → projects}/finish_task.rjs +0 -0
- data/app/views/projects/list.rhtml +16 -0
- data/app/views/{backlogs → projects}/move_task_to_period.rjs +0 -0
- data/app/views/{backlogs → projects}/new.rhtml +1 -1
- data/app/views/{backlogs → projects}/reopen_task.rjs +0 -0
- data/app/views/{backlogs → projects}/show.rhtml +6 -6
- data/app/views/search/results.rhtml +3 -3
- data/app/views/tasks/_backlog_header.rhtml +4 -4
- data/app/views/tasks/_completed.rhtml +2 -2
- data/app/views/tasks/_form.rhtml +13 -13
- data/app/views/tasks/_task.rhtml +10 -10
- data/app/views/tasks/edit.rhtml +1 -1
- data/app/views/tasks/list.rhtml +3 -3
- data/app/views/tasks/list_started.rhtml +4 -4
- data/app/views/tasks/start_work.rjs +1 -1
- data/app/views/user/login.rhtml +1 -1
- data/app/views/user/signup.rhtml +1 -1
- data/app/views/user/welcome.rhtml +1 -1
- data/app/views/works/_description_list.rhtml +1 -1
- data/app/views/works/_form.rhtml +5 -5
- data/app/views/works/_new_row.rhtml +8 -8
- data/app/views/works/_row.rhtml +1 -1
- data/app/views/works/_task_id_list.rhtml +1 -1
- data/app/views/works/daily_work_sheet.rhtml +1 -1
- data/app/views/works/list.rhtml +5 -5
- data/app/views/works/list_excel.rhtml +2 -2
- data/app/views/works/timeliste.rhtml +14 -14
- data/app/views/works/weekly_work_sheet.rhtml +5 -5
- data/app/views/works/weekly_work_sheet_details.rhtml +5 -5
- data/backlog.gemspec +44 -0
- data/bin/backlog +5 -1
- data/config.ru +4 -0
- data/config/application.rb +10 -0
- data/config/boot.rb +12 -116
- data/config/database.yml +3 -6
- data/config/database.yml~ +17 -0
- data/config/environment.rb +28 -49
- data/config/environments/development.rb +24 -20
- data/config/environments/development.rb.rails2 +26 -0
- data/config/environments/production.rb +26 -22
- data/config/environments/test.rb +20 -15
- data/config/environments/user_environment.rb +1 -1
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/jdbc.rb +1 -1
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/locales/en.yml +22 -11
- data/config/locales/no.yml +1 -0
- data/config/routes.rb +4 -5
- data/cruise_build.sh +6 -2
- data/db/migrate/004_add_period.rb +22 -22
- data/db/migrate/015_add_user_option.rb +5 -19
- data/db/migrate/017_increase_backlog_name_limit.rb +10 -0
- data/db/migrate/021_create_work_accounts.rb +0 -2
- data/db/migrate/20101006092700_rename_backlogs_to_projects.rb +22 -0
- data/db/migrate/20101006092700_rename_backlogs_to_projects.rb~ +22 -0
- data/db/schema.rb +27 -30
- data/db/seeds.rb +7 -0
- data/lib/array_helper.rb +0 -8
- data/lib/class_table_inheritance.rb +8 -7
- data/lib/tasks/backup.rake +3 -3
- data/lib/tasks/jdbc.rake +2 -2
- data/lib/version_from_history.rb +1 -1
- data/public/404.html +23 -7
- data/public/422.html +26 -0
- data/public/500.html +23 -6
- data/public/images/rails.png +0 -0
- data/public/javascripts/controls.js +5 -3
- data/public/javascripts/dragdrop.js +7 -6
- data/public/javascripts/effects.js +8 -13
- data/public/javascripts/prototype.js +3381 -1700
- data/public/javascripts/rails.js +175 -0
- data/public/robots.txt +5 -1
- data/script/rails +6 -0
- data/test/client/login.rb +0 -2
- data/test/client/login_test.rb +1 -1
- data/test/client/setup.rb +25 -24
- data/test/fixtures/{backlogs.yml → projects.yml} +2 -2
- data/test/fixtures/tasks.yml +9 -9
- data/test/fixtures/work_lock_subscriptions.yml +2 -2
- data/test/fixtures/works.yml +7 -7
- data/test/functional/periods_controller_test.rb +1 -1
- data/test/functional/{backlogs_controller_test.rb → projects_controller_test.rb} +22 -21
- data/test/functional/search_controller_test.rb +1 -1
- data/test/functional/tasks_controller_test.rb +17 -17
- data/test/functional/user_controller_test.rb +16 -21
- data/test/functional/welcome_controller_test.rb +4 -3
- data/test/functional/works_controller_test.rb +5 -5
- data/test/integration/user_system_test.rb +1 -1
- data/test/mocks/test/clock.rb +1 -1
- data/test/performance/browsing_test.rb +9 -0
- data/test/performance/common.rb +1 -1
- data/test/test_helper.rb +23 -6
- data/test/test_helper.rb~ +121 -0
- data/test/unit/user_test.rb +3 -3
- data/test/unit/work_test.rb +7 -7
- data/vendor/plugins/assert_cookie/lib/assert_cookie.rb +0 -2
- data/vendor/plugins/{foreign_key_migrations → dynamic_form}/MIT-LICENSE +1 -1
- data/vendor/plugins/dynamic_form/README +13 -0
- data/vendor/plugins/dynamic_form/Rakefile +10 -0
- data/vendor/plugins/dynamic_form/dynamic_form.gemspec +12 -0
- data/vendor/plugins/dynamic_form/init.rb +1 -0
- data/vendor/plugins/dynamic_form/lib/action_view/helpers/dynamic_form.rb +300 -0
- data/vendor/plugins/dynamic_form/lib/action_view/locale/en.yml +8 -0
- data/vendor/plugins/dynamic_form/lib/dynamic_form.rb +5 -0
- data/vendor/plugins/dynamic_form/test/dynamic_form_i18n_test.rb +42 -0
- data/vendor/plugins/dynamic_form/test/dynamic_form_test.rb +370 -0
- data/vendor/plugins/dynamic_form/test/test_helper.rb +9 -0
- data/vendor/plugins/prototype_legacy_helper/lib/prototype_legacy_helper.rb +432 -0
- data/vendor/plugins/prototype_legacy_helper/test/test_prototype_helper.rb +297 -0
- data/vendor/plugins/rails_time/test/debug.log +1 -0
- data/vendor/plugins/{redhillonrails_core → verification}/MIT-LICENSE +1 -1
- data/vendor/plugins/verification/README +34 -0
- data/vendor/plugins/verification/Rakefile +22 -0
- data/vendor/plugins/verification/init.rb +3 -0
- data/vendor/plugins/verification/lib/action_controller/verification.rb +132 -0
- data/vendor/plugins/verification/test/test_helper.rb +18 -0
- data/vendor/plugins/verification/test/verification_test.rb +270 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +1 -1
- metadata +115 -134
- data/Gemfile~ +0 -4
- data/History.txt~ +0 -961
- data/LICENSE_LOCALIZATION +0 -20
- data/README_LOCALIZATION +0 -61
- data/README_RAILS +0 -180
- data/app/views/backlogs/_form.rhtml +0 -44
- data/app/views/backlogs/_name_list.rhtml +0 -5
- data/app/views/backlogs/edit.rhtml +0 -14
- data/app/views/backlogs/list.rhtml +0 -16
- data/app/views/layouts/mwrt002.rhtml +0 -43
- data/config/initializers/mongrel.rb +0 -83
- data/config/preinitializer.rb +0 -20
- data/config/warble.rb~ +0 -84
- data/db/migrate/017_insert_datek_projects.rb +0 -98
- data/lib/change_column_null_migration_fix.rb +0 -15
- data/no_test.rb~ +0 -6
- data/public/dispatch.cgi +0 -10
- data/public/dispatch.fcgi +0 -24
- data/public/dispatch.rb +0 -10
- data/script/about +0 -3
- data/script/breakpointer +0 -3
- data/script/console +0 -3
- data/script/dbconsole +0 -3
- data/script/destroy +0 -3
- data/script/generate +0 -3
- data/script/performance/benchmarker +0 -3
- data/script/performance/profiler +0 -3
- data/script/plugin +0 -3
- data/script/process/inspector +0 -3
- data/script/process/reaper +0 -3
- data/script/process/spawner +0 -3
- data/script/runner +0 -3
- data/script/server +0 -3
- data/test/client/login.rb~ +0 -33
- data/test/mocks/test/user_notify.rb +0 -16
- data/vendor/plugins/foreign_key_migrations/CHANGELOG +0 -103
- data/vendor/plugins/foreign_key_migrations/README +0 -87
- data/vendor/plugins/foreign_key_migrations/about.yml +0 -5
- data/vendor/plugins/foreign_key_migrations/init.rb +0 -1
- data/vendor/plugins/foreign_key_migrations/install.rb +0 -1
- data/vendor/plugins/foreign_key_migrations/lib/foreign_key_migrations.rb +0 -3
- data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/base.rb +0 -22
- data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/abstract_adapter.rb +0 -22
- data/vendor/plugins/foreign_key_migrations/lib/red_hill_consulting/foreign_key_migrations/active_record/connection_adapters/table_definition.rb +0 -28
- data/vendor/plugins/lightwindow_helper/README +0 -33
- data/vendor/plugins/lightwindow_helper/assets/images/ajax-loading.gif +0 -0
- data/vendor/plugins/lightwindow_helper/assets/images/arrow-down.gif +0 -0
- data/vendor/plugins/lightwindow_helper/assets/images/arrow-up.gif +0 -0
- data/vendor/plugins/lightwindow_helper/assets/images/black-70.png +0 -0
- data/vendor/plugins/lightwindow_helper/assets/images/black.png +0 -0
- data/vendor/plugins/lightwindow_helper/assets/images/nextlabel.gif +0 -0
- data/vendor/plugins/lightwindow_helper/assets/images/prevlabel.gif +0 -0
- data/vendor/plugins/lightwindow_helper/assets/javascripts/lightwindow.js +0 -1921
- data/vendor/plugins/lightwindow_helper/assets/stylesheets/lightwindow.css +0 -376
- data/vendor/plugins/lightwindow_helper/init.rb +0 -1
- data/vendor/plugins/lightwindow_helper/install.rb +0 -7
- data/vendor/plugins/lightwindow_helper/lib/lightwindow_helper.rb +0 -31
- data/vendor/plugins/redhillonrails_core/CHANGELOG +0 -150
- data/vendor/plugins/redhillonrails_core/README +0 -124
- data/vendor/plugins/redhillonrails_core/init.rb +0 -19
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/base.rb +0 -54
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/abstract_adapter.rb +0 -31
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/column.rb +0 -21
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/foreign_key_definition.rb +0 -26
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/index_definition.rb +0 -11
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/mysql_adapter.rb +0 -74
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/mysql_column.rb +0 -8
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/postgresql_adapter.rb +0 -99
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/schema_statements.rb +0 -16
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/sqlite3_adapter.rb +0 -9
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/connection_adapters/table_definition.rb +0 -27
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/schema.rb +0 -27
- data/vendor/plugins/redhillonrails_core/lib/red_hill_consulting/core/active_record/schema_dumper.rb +0 -47
- data/vendor/plugins/transactional_migrations/CHANGELOG +0 -9
- data/vendor/plugins/transactional_migrations/MIT-LICENSE +0 -20
- data/vendor/plugins/transactional_migrations/README +0 -15
- data/vendor/plugins/transactional_migrations/about.yml +0 -5
- data/vendor/plugins/transactional_migrations/init.rb +0 -1
- data/vendor/plugins/transactional_migrations/lib/red_hill_consulting/transactional_migrations/active_record/migration.rb +0 -19
@@ -0,0 +1,175 @@
|
|
1
|
+
(function() {
|
2
|
+
// Technique from Juriy Zaytsev
|
3
|
+
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
|
4
|
+
function isEventSupported(eventName) {
|
5
|
+
var el = document.createElement('div');
|
6
|
+
eventName = 'on' + eventName;
|
7
|
+
var isSupported = (eventName in el);
|
8
|
+
if (!isSupported) {
|
9
|
+
el.setAttribute(eventName, 'return;');
|
10
|
+
isSupported = typeof el[eventName] == 'function';
|
11
|
+
}
|
12
|
+
el = null;
|
13
|
+
return isSupported;
|
14
|
+
}
|
15
|
+
|
16
|
+
function isForm(element) {
|
17
|
+
return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
|
18
|
+
}
|
19
|
+
|
20
|
+
function isInput(element) {
|
21
|
+
if (Object.isElement(element)) {
|
22
|
+
var name = element.nodeName.toUpperCase()
|
23
|
+
return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
|
24
|
+
}
|
25
|
+
else return false
|
26
|
+
}
|
27
|
+
|
28
|
+
var submitBubbles = isEventSupported('submit'),
|
29
|
+
changeBubbles = isEventSupported('change')
|
30
|
+
|
31
|
+
if (!submitBubbles || !changeBubbles) {
|
32
|
+
// augment the Event.Handler class to observe custom events when needed
|
33
|
+
Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
|
34
|
+
function(init, element, eventName, selector, callback) {
|
35
|
+
init(element, eventName, selector, callback)
|
36
|
+
// is the handler being attached to an element that doesn't support this event?
|
37
|
+
if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
|
38
|
+
(!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
|
39
|
+
// "submit" => "emulated:submit"
|
40
|
+
this.eventName = 'emulated:' + this.eventName
|
41
|
+
}
|
42
|
+
}
|
43
|
+
)
|
44
|
+
}
|
45
|
+
|
46
|
+
if (!submitBubbles) {
|
47
|
+
// discover forms on the page by observing focus events which always bubble
|
48
|
+
document.on('focusin', 'form', function(focusEvent, form) {
|
49
|
+
// special handler for the real "submit" event (one-time operation)
|
50
|
+
if (!form.retrieve('emulated:submit')) {
|
51
|
+
form.on('submit', function(submitEvent) {
|
52
|
+
var emulated = form.fire('emulated:submit', submitEvent, true)
|
53
|
+
// if custom event received preventDefault, cancel the real one too
|
54
|
+
if (emulated.returnValue === false) submitEvent.preventDefault()
|
55
|
+
})
|
56
|
+
form.store('emulated:submit', true)
|
57
|
+
}
|
58
|
+
})
|
59
|
+
}
|
60
|
+
|
61
|
+
if (!changeBubbles) {
|
62
|
+
// discover form inputs on the page
|
63
|
+
document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
|
64
|
+
// special handler for real "change" events
|
65
|
+
if (!input.retrieve('emulated:change')) {
|
66
|
+
input.on('change', function(changeEvent) {
|
67
|
+
input.fire('emulated:change', changeEvent, true)
|
68
|
+
})
|
69
|
+
input.store('emulated:change', true)
|
70
|
+
}
|
71
|
+
})
|
72
|
+
}
|
73
|
+
|
74
|
+
function handleRemote(element) {
|
75
|
+
var method, url, params;
|
76
|
+
|
77
|
+
var event = element.fire("ajax:before");
|
78
|
+
if (event.stopped) return false;
|
79
|
+
|
80
|
+
if (element.tagName.toLowerCase() === 'form') {
|
81
|
+
method = element.readAttribute('method') || 'post';
|
82
|
+
url = element.readAttribute('action');
|
83
|
+
params = element.serialize();
|
84
|
+
} else {
|
85
|
+
method = element.readAttribute('data-method') || 'get';
|
86
|
+
url = element.readAttribute('href');
|
87
|
+
params = {};
|
88
|
+
}
|
89
|
+
|
90
|
+
new Ajax.Request(url, {
|
91
|
+
method: method,
|
92
|
+
parameters: params,
|
93
|
+
evalScripts: true,
|
94
|
+
|
95
|
+
onComplete: function(request) { element.fire("ajax:complete", request); },
|
96
|
+
onSuccess: function(request) { element.fire("ajax:success", request); },
|
97
|
+
onFailure: function(request) { element.fire("ajax:failure", request); }
|
98
|
+
});
|
99
|
+
|
100
|
+
element.fire("ajax:after");
|
101
|
+
}
|
102
|
+
|
103
|
+
function handleMethod(element) {
|
104
|
+
var method = element.readAttribute('data-method'),
|
105
|
+
url = element.readAttribute('href'),
|
106
|
+
csrf_param = $$('meta[name=csrf-param]')[0],
|
107
|
+
csrf_token = $$('meta[name=csrf-token]')[0];
|
108
|
+
|
109
|
+
var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
|
110
|
+
element.parentNode.insert(form);
|
111
|
+
|
112
|
+
if (method !== 'post') {
|
113
|
+
var field = new Element('input', { type: 'hidden', name: '_method', value: method });
|
114
|
+
form.insert(field);
|
115
|
+
}
|
116
|
+
|
117
|
+
if (csrf_param) {
|
118
|
+
var param = csrf_param.readAttribute('content'),
|
119
|
+
token = csrf_token.readAttribute('content'),
|
120
|
+
field = new Element('input', { type: 'hidden', name: param, value: token });
|
121
|
+
form.insert(field);
|
122
|
+
}
|
123
|
+
|
124
|
+
form.submit();
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
document.on("click", "*[data-confirm]", function(event, element) {
|
129
|
+
var message = element.readAttribute('data-confirm');
|
130
|
+
if (!confirm(message)) event.stop();
|
131
|
+
});
|
132
|
+
|
133
|
+
document.on("click", "a[data-remote]", function(event, element) {
|
134
|
+
if (event.stopped) return;
|
135
|
+
handleRemote(element);
|
136
|
+
event.stop();
|
137
|
+
});
|
138
|
+
|
139
|
+
document.on("click", "a[data-method]", function(event, element) {
|
140
|
+
if (event.stopped) return;
|
141
|
+
handleMethod(element);
|
142
|
+
event.stop();
|
143
|
+
});
|
144
|
+
|
145
|
+
document.on("submit", function(event) {
|
146
|
+
var element = event.findElement(),
|
147
|
+
message = element.readAttribute('data-confirm');
|
148
|
+
if (message && !confirm(message)) {
|
149
|
+
event.stop();
|
150
|
+
return false;
|
151
|
+
}
|
152
|
+
|
153
|
+
var inputs = element.select("input[type=submit][data-disable-with]");
|
154
|
+
inputs.each(function(input) {
|
155
|
+
input.disabled = true;
|
156
|
+
input.writeAttribute('data-original-value', input.value);
|
157
|
+
input.value = input.readAttribute('data-disable-with');
|
158
|
+
});
|
159
|
+
|
160
|
+
var element = event.findElement("form[data-remote]");
|
161
|
+
if (element) {
|
162
|
+
handleRemote(element);
|
163
|
+
event.stop();
|
164
|
+
}
|
165
|
+
});
|
166
|
+
|
167
|
+
document.on("ajax:after", "form", function(event, element) {
|
168
|
+
var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
|
169
|
+
inputs.each(function(input) {
|
170
|
+
input.value = input.readAttribute('data-original-value');
|
171
|
+
input.removeAttribute('data-original-value');
|
172
|
+
input.disabled = false;
|
173
|
+
});
|
174
|
+
});
|
175
|
+
})();
|
data/public/robots.txt
CHANGED
@@ -1 +1,5 @@
|
|
1
|
-
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
|
1
|
+
# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
|
2
|
+
#
|
3
|
+
# To ban all spiders from the entire site uncomment the next two lines:
|
4
|
+
# User-Agent: *
|
5
|
+
# Disallow: /
|
data/script/rails
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby1.8
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/test/client/login.rb
CHANGED
data/test/client/login_test.rb
CHANGED
data/test/client/setup.rb
CHANGED
@@ -1,24 +1,25 @@
|
|
1
|
-
END {$ff.close if $ff} # close ff at completion of the tests
|
2
|
-
|
3
|
-
# libraries used by feature tests
|
4
|
-
require 'rubygems'
|
5
|
-
gem 'firewatir'
|
6
|
-
require 'firewatir'
|
7
|
-
require 'test/unit'
|
8
|
-
require 'test/unit/ui/console/testrunner'
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
END {$ff.close if $ff} # close ff at completion of the tests
|
2
|
+
|
3
|
+
# libraries used by feature tests
|
4
|
+
require 'rubygems'
|
5
|
+
gem 'firewatir'
|
6
|
+
require 'firewatir'
|
7
|
+
require 'test/unit'
|
8
|
+
require 'test/unit/ui/console/testrunner'
|
9
|
+
|
10
|
+
$ff = FireWatir::Firefox.new()
|
11
|
+
|
12
|
+
HOST = 'localhost'
|
13
|
+
APP_URL = "http://#{HOST}:3000"
|
14
|
+
|
15
|
+
if defined?(JRUBY_VERSION)
|
16
|
+
server_thread = Thread.start{load 'script/server'}
|
17
|
+
elsif RUBY_PLATFORM !~ /i386-mswin32/
|
18
|
+
gem 'slave'
|
19
|
+
require 'slave'
|
20
|
+
ENV['RAILS_ENV'] = 'test'
|
21
|
+
server_thread = Slave.object(:async=>true) {load 'script/server'}
|
22
|
+
sleep 3
|
23
|
+
else
|
24
|
+
puts 'Not spawning server on windows'
|
25
|
+
end
|
data/test/fixtures/tasks.yml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
- first:
|
3
3
|
id: 1
|
4
4
|
created_at: 2007-06-11
|
5
|
-
|
5
|
+
project_id: 1
|
6
6
|
period_id: 2
|
7
7
|
description: first task
|
8
8
|
position: 1
|
@@ -10,14 +10,14 @@
|
|
10
10
|
- another:
|
11
11
|
id: 2
|
12
12
|
created_at: 2007-06-12
|
13
|
-
|
13
|
+
project_id: 1
|
14
14
|
period_id: 3
|
15
15
|
description: second task
|
16
16
|
position: 1
|
17
17
|
- postponed:
|
18
18
|
id: 3
|
19
19
|
created_at: 2007-06-12
|
20
|
-
|
20
|
+
project_id: 1
|
21
21
|
period_id: 3
|
22
22
|
description: postponed task
|
23
23
|
position: NULL
|
@@ -26,14 +26,14 @@
|
|
26
26
|
- started:
|
27
27
|
id: 4
|
28
28
|
created_at: 2007-08-02 14:15:42
|
29
|
-
|
29
|
+
project_id: 2
|
30
30
|
period_id: 3
|
31
31
|
description: third task
|
32
32
|
position: 2
|
33
33
|
- in_last_period:
|
34
34
|
id: 5
|
35
35
|
created_at: 2007-08-02 14:15:42
|
36
|
-
|
36
|
+
project_id: 1
|
37
37
|
period_id: 4
|
38
38
|
description: task in last period
|
39
39
|
initial_estimate: 1.0
|
@@ -42,13 +42,13 @@
|
|
42
42
|
- not_planned:
|
43
43
|
id: 6
|
44
44
|
created_at: 2007-08-02 14:15:42
|
45
|
-
|
45
|
+
project_id: 1
|
46
46
|
description: unplanned task
|
47
47
|
position: 1
|
48
48
|
- supertask:
|
49
49
|
id: 7
|
50
50
|
created_at: 2007-06-12
|
51
|
-
|
51
|
+
project_id: 1
|
52
52
|
period_id: 3
|
53
53
|
description: super task
|
54
54
|
position: 3
|
@@ -61,7 +61,7 @@
|
|
61
61
|
- in_ancient:
|
62
62
|
id: 9
|
63
63
|
created_at: 2007-06-03
|
64
|
-
|
64
|
+
project_id: 1
|
65
65
|
period_id: 1
|
66
66
|
description: ancient task
|
67
67
|
position: 1
|
@@ -74,7 +74,7 @@
|
|
74
74
|
- completed:
|
75
75
|
id: 11
|
76
76
|
created_at: 2007-06-12
|
77
|
-
|
77
|
+
project_id: 1
|
78
78
|
period_id: 3
|
79
79
|
description: completed task
|
80
80
|
position: NULL
|
data/test/fixtures/works.yml
CHANGED
@@ -6,13 +6,13 @@ first:
|
|
6
6
|
start_time: !time 13:35:00
|
7
7
|
completed_at: 2007-06-12T14:35:00
|
8
8
|
hours: 30.0
|
9
|
-
|
9
|
+
project_id: 1
|
10
10
|
started:
|
11
11
|
id: 2
|
12
12
|
task_id: 4
|
13
13
|
started_on: 2007-06-12
|
14
14
|
start_time: !time 13:35:00
|
15
|
-
|
15
|
+
project_id: 1
|
16
16
|
personal:
|
17
17
|
id: 3
|
18
18
|
task_id: 1
|
@@ -21,17 +21,17 @@ personal:
|
|
21
21
|
completed_at: 2007-06-12T14:35:00
|
22
22
|
user_id: 1000001
|
23
23
|
hours: 40.0
|
24
|
-
|
24
|
+
project_id: 1
|
25
25
|
brother_of_started:
|
26
26
|
id: 5
|
27
27
|
task_id: 4
|
28
28
|
started_on: 2007-06-12
|
29
29
|
start_time: !time 13:35:00
|
30
30
|
completed_at: 2007-06-12T14:35:00
|
31
|
-
|
31
|
+
project_id: 1
|
32
32
|
without_task:
|
33
33
|
id: 6
|
34
|
-
|
34
|
+
project_id: 1
|
35
35
|
started_on: 2007-06-13
|
36
36
|
start_time: !time 13:35:00
|
37
37
|
completed_at: 2007-06-13T14:35:00
|
@@ -41,7 +41,7 @@ short:
|
|
41
41
|
id: 7
|
42
42
|
started_on: 2007-06-18
|
43
43
|
start_time: !time 10:00:00
|
44
|
-
completed_at: 2007-06-18T10:05:00
|
44
|
+
completed_at: <%=Time.parse('2007-06-18T10:05:00').utc.iso8601%>
|
45
45
|
hours: 0.083
|
46
|
-
|
46
|
+
project_id: 1
|
47
47
|
user_id: 1000001
|
@@ -216,7 +216,7 @@ class PeriodsControllerTest < ActionController::TestCase
|
|
216
216
|
target_period = periods(:active)
|
217
217
|
|
218
218
|
post :move_task_to_period, {"id"=> task_to_move.id,
|
219
|
-
"detour"=>{"action"=>"edit_no_layout", "id"=>"39", "controller"=>"
|
219
|
+
"detour"=>{"action"=>"edit_no_layout", "id"=>"39", "controller"=>"projects"},
|
220
220
|
"period_id"=> target_period.id
|
221
221
|
}
|
222
222
|
|
@@ -1,15 +1,15 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
require '
|
2
|
+
require 'projects_controller'
|
3
3
|
|
4
4
|
# Re-raise errors caught by the controller.
|
5
|
-
class
|
5
|
+
class ProjectsController; def rescue_action(e) raise e end; end
|
6
6
|
|
7
|
-
class
|
7
|
+
class ProjectsControllerTest < ActionController::TestCase
|
8
8
|
main_scenario
|
9
9
|
|
10
10
|
def setup
|
11
11
|
@user_controller = UserController.new
|
12
|
-
@controller =
|
12
|
+
@controller = ProjectsController.new
|
13
13
|
@request = ActionController::TestRequest.new
|
14
14
|
@response = ActionController::TestResponse.new
|
15
15
|
@request.session[:user_id] = 1000001
|
@@ -20,7 +20,8 @@ class BacklogsControllerTest < ActionController::TestCase
|
|
20
20
|
Estimate.delete_all
|
21
21
|
TaskFile.delete_all
|
22
22
|
Task.delete_all
|
23
|
-
|
23
|
+
ActiveRecord::Base.connection.execute("DELETE FROM work_lock_subscriptions")
|
24
|
+
Project.delete_all
|
24
25
|
get :index
|
25
26
|
assert_response :redirect
|
26
27
|
assert_redirected_to :action => :new
|
@@ -30,7 +31,7 @@ class BacklogsControllerTest < ActionController::TestCase
|
|
30
31
|
Work.delete(works(:started).id)
|
31
32
|
get :index
|
32
33
|
assert_response :redirect
|
33
|
-
assert_redirected_to :action => :show, :id =>
|
34
|
+
assert_redirected_to :action => :show, :id => projects(:first)
|
34
35
|
end
|
35
36
|
|
36
37
|
def test_index_list_started
|
@@ -45,8 +46,8 @@ class BacklogsControllerTest < ActionController::TestCase
|
|
45
46
|
assert_response :success
|
46
47
|
assert_template 'show'
|
47
48
|
|
48
|
-
assert_not_nil assigns(:
|
49
|
-
assert assigns(:
|
49
|
+
assert_not_nil assigns(:project)
|
50
|
+
assert assigns(:project).valid?
|
50
51
|
assert_not_nil assigns(:tasks)
|
51
52
|
end
|
52
53
|
|
@@ -56,18 +57,18 @@ class BacklogsControllerTest < ActionController::TestCase
|
|
56
57
|
assert_response :success
|
57
58
|
assert_template 'new'
|
58
59
|
|
59
|
-
assert_not_nil assigns(:
|
60
|
+
assert_not_nil assigns(:project)
|
60
61
|
end
|
61
62
|
|
62
63
|
def test_create
|
63
|
-
|
64
|
+
num_projects = Project.count
|
64
65
|
@request.session[:user_id] = 1000001
|
65
|
-
post :create, :
|
66
|
+
post :create, :project => {:name => 'house work', :track_times => true}
|
66
67
|
|
67
|
-
assert_response :redirect, assigns(:
|
68
|
-
assert_redirected_to :action => :show, :id => assigns(:
|
68
|
+
assert_response :redirect, assigns(:project).errors.to_a.inspect
|
69
|
+
assert_redirected_to :action => :show, :id => assigns(:project).id
|
69
70
|
|
70
|
-
assert_equal
|
71
|
+
assert_equal num_projects + 1, Project.count
|
71
72
|
end
|
72
73
|
|
73
74
|
def test_edit
|
@@ -76,8 +77,8 @@ class BacklogsControllerTest < ActionController::TestCase
|
|
76
77
|
assert_response :success
|
77
78
|
assert_template 'edit'
|
78
79
|
|
79
|
-
assert_not_nil assigns(:
|
80
|
-
assert assigns(:
|
80
|
+
assert_not_nil assigns(:project)
|
81
|
+
assert assigns(:project).valid?
|
81
82
|
end
|
82
83
|
|
83
84
|
def test_update
|
@@ -87,21 +88,21 @@ class BacklogsControllerTest < ActionController::TestCase
|
|
87
88
|
end
|
88
89
|
|
89
90
|
def test_destroy
|
90
|
-
assert_not_nil
|
91
|
+
assert_not_nil Project.find(1)
|
91
92
|
|
92
93
|
post :destroy, :id => 1
|
93
94
|
assert_response :redirect
|
94
95
|
assert_redirected_to :action => :index
|
95
96
|
|
96
97
|
assert_raise(ActiveRecord::RecordNotFound) {
|
97
|
-
|
98
|
+
Project.find(1)
|
98
99
|
}
|
99
100
|
end
|
100
101
|
|
101
|
-
def
|
102
|
+
def test_autologin_with_token_start_page
|
102
103
|
set_logged_out
|
103
|
-
@request.cookies['autologin'] =
|
104
|
-
@request.cookies['token']
|
104
|
+
@request.cookies['autologin'] = {:value => ['1000007'], :expires => 30.days.from_now}
|
105
|
+
@request.cookies['token'] = {:value => ['random_token_string'], :expires => 30.days.from_now}
|
105
106
|
get :index
|
106
107
|
assert_logged_in users(:no_password_user)
|
107
108
|
assert_response :redirect
|