backlog 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +28 -0
- data/README.txt +23 -2
- data/app/controllers/application.rb +15 -2
- data/app/controllers/periods_controller.rb +3 -0
- data/app/controllers/tasks_controller.rb +2 -2
- data/app/controllers/user_controller.rb +2 -2
- data/app/controllers/work_accounts_controller.rb +14 -0
- data/app/controllers/works_controller.rb +23 -3
- data/app/models/report_filter.rb +7 -3
- data/app/models/task.rb +11 -10
- data/app/models/work.rb +3 -2
- data/app/views/customers/_name_list.rhtml +5 -0
- data/app/views/periods/_show_active.rhtml +1 -0
- data/app/views/periods/_title.rhtml +8 -1
- data/app/views/periods/edit.rhtml +1 -1
- data/app/views/periods/order.rjs +0 -1
- data/app/views/tasks/_task.rhtml +6 -5
- data/app/views/user/login.rhtml +1 -1
- data/app/views/work_accounts/_title.rhtml +4 -0
- data/app/views/work_accounts/edit.rhtml +1 -3
- data/app/views/work_accounts/list.rhtml +9 -3
- data/app/views/work_accounts/show.rhtml +47 -30
- data/app/views/works/_form.rhtml +6 -0
- data/app/views/works/_row.rhtml +16 -9
- data/app/views/works/_row_field.rhtml +2 -2
- data/app/views/works/daily_work_sheet.rhtml +37 -7
- data/app/views/works/daily_work_sheet_old.rhtml +93 -0
- data/app/views/works/list.rhtml +11 -5
- data/app/views/works/update_row.rjs +5 -2
- data/config/environment.rb +19 -3
- data/lang/en.yaml +5 -0
- data/lang/no.yaml +5 -0
- data/lib/class_table_inheritance.rb +10 -3
- data/no_test.rb~ +6 -0
- data/test/client/login.rb +25 -0
- data/test/client/login.rb~ +33 -0
- data/test/client/login_test.rb +64 -0
- data/test/client/setup.rb +24 -0
- data/test/functional/works_controller_test.rb +3 -2
- data/test/unit/party_test.rb +10 -0
- data/test/unit/user_test.rb +15 -17
- metadata +12 -2
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require File.join(File.dirname(__FILE__), 'setup')
|
3
|
+
|
4
|
+
include Test::Unit::Assertions
|
5
|
+
include FireWatir
|
6
|
+
|
7
|
+
def login
|
8
|
+
$ff.goto("#{APP_URL}/user/login")
|
9
|
+
|
10
|
+
form = $ff.form(:id, :loginForm)
|
11
|
+
username = $ff.text_field(:id, 'user_login')
|
12
|
+
username.value = 'tesla'
|
13
|
+
|
14
|
+
password = form.text_field(:id, 'user_password')
|
15
|
+
password.value = 'atest'
|
16
|
+
|
17
|
+
form.submit
|
18
|
+
if $ff.text !~ /Login succeeded/ then "Login failed" end
|
19
|
+
end
|
20
|
+
|
21
|
+
def logout
|
22
|
+
$ff.goto("#{APP_URL}/user/logout")
|
23
|
+
end
|
24
|
+
|
25
|
+
login()
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'setup.rb'
|
2
|
+
|
3
|
+
include FireWatir
|
4
|
+
|
5
|
+
def login
|
6
|
+
$ff.goto("#{APP}/acegilogin.jsp")
|
7
|
+
|
8
|
+
form = $ff.form('loginForm')
|
9
|
+
username = form.text_field(:name, 'j_username')
|
10
|
+
username.value = 'test'
|
11
|
+
|
12
|
+
password = form.text_field(:name, 'j_password')
|
13
|
+
password.value = 'test'
|
14
|
+
|
15
|
+
form.submit
|
16
|
+
end
|
17
|
+
|
18
|
+
def logout
|
19
|
+
$ff.goto("#{APP}/index.jsp?logoff=true")
|
20
|
+
end
|
21
|
+
|
22
|
+
def choose_customer_application(appname="svdrammen")
|
23
|
+
$ff.select_list(:name, "jumpmenu").option(:text, /#{appname}/).select
|
24
|
+
sleep 2
|
25
|
+
end
|
26
|
+
|
27
|
+
def choose_language(language="English")
|
28
|
+
$ff.link(:text, "#{language}").click
|
29
|
+
end
|
30
|
+
|
31
|
+
login()
|
32
|
+
choose_language()
|
33
|
+
choose_customer_application("svdrammen")
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require File.join(File.dirname(__FILE__), 'login')
|
3
|
+
|
4
|
+
class LoginTest < Test::Unit::TestCase
|
5
|
+
main_scenario
|
6
|
+
|
7
|
+
def setup
|
8
|
+
login
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
logout
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_redirect_to_login
|
16
|
+
logout
|
17
|
+
$ff.goto(APP_URL)
|
18
|
+
assert($ff.form(:id, "loginForm").exists?)
|
19
|
+
assert(!$ff.form(:name, "missing").exists?)
|
20
|
+
|
21
|
+
assert($ff.form(:id, "loginForm").exists?)
|
22
|
+
assert(!$ff.form( "missing").exists?)
|
23
|
+
|
24
|
+
assert($ff.form(:index, 1).exists?)
|
25
|
+
assert(!$ff.form(:index, 88).exists?)
|
26
|
+
|
27
|
+
assert($ff.form(:method, "post").exists?)
|
28
|
+
assert(!$ff.form(:method, "missing").exists?)
|
29
|
+
|
30
|
+
assert($ff.form(:action, /j_acegi_security_check/).exists?)
|
31
|
+
assert(!$ff.form(:action, "missing").exists?)
|
32
|
+
|
33
|
+
# 2 logouts -> problems for the next tests, redirects to login
|
34
|
+
login
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_login_logout
|
38
|
+
$ff.goto("#{APP_URL}/user/login")
|
39
|
+
assert_and_submit_login_form
|
40
|
+
$ff.goto("#{APP_URL}/user/logout")
|
41
|
+
assert_and_submit_login_form
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_presence_of_Drammen
|
45
|
+
assert($ff.div(:id, "spotlight").exists?)
|
46
|
+
assert_match /Started tasks/, $ff.text
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def assert_and_submit_login_form
|
52
|
+
form = $ff.form(:id, 'loginForm')
|
53
|
+
assert(form.exists?)
|
54
|
+
assert(form.text_field(:id, 'user_login').exists?)
|
55
|
+
assert(form.text_field(:name, 'user[password]').exists?)
|
56
|
+
assert(form.text_field(:id, 'user_login').exists?)
|
57
|
+
assert(form.text_field(:name, 'user[password]').exists?)
|
58
|
+
assert($ff.button(:value, "Log in").exists? )
|
59
|
+
|
60
|
+
form.text_field(:name, 'user[login]').value = 'tesla'
|
61
|
+
form.text_field(:name, 'user[password]').value = 'atest'
|
62
|
+
form.submit
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,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
|
+
require 'firewatir/testUnitAddons'
|
10
|
+
|
11
|
+
$ff = FireWatir::Firefox.new()
|
12
|
+
|
13
|
+
HOST = 'localhost'
|
14
|
+
APP_URL = "http://#{HOST}:3000"
|
15
|
+
|
16
|
+
if RUBY_PLATFORM !~ /i386-mswin32/
|
17
|
+
gem 'slave'
|
18
|
+
require 'slave'
|
19
|
+
ENV['RAILS_ENV'] = 'test'
|
20
|
+
server_thread = Slave.object(:async=>true) {load 'script/server'}
|
21
|
+
sleep 3
|
22
|
+
else
|
23
|
+
puts 'Not spawning server on windows'
|
24
|
+
end
|
@@ -81,10 +81,11 @@ class WorksControllerTest < Test::Unit::TestCase
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def test_update_time
|
84
|
+
before = works(:first)
|
85
|
+
old_start_time = before.started_at
|
86
|
+
expected_time = Time.local(old_start_time.year , old_start_time.month, old_start_time.day, 8, 15)
|
84
87
|
post :update_time, :id => 1, :work => {"started_at_time"=>"8:15"}
|
85
88
|
assert_response :success
|
86
|
-
now = Time.now
|
87
|
-
expected_time = Time.local(now.year , now.month, now.day, 8, 15)
|
88
89
|
assert_equal expected_time.iso8601, assigns(:work).started_at.iso8601
|
89
90
|
end
|
90
91
|
|
data/test/unit/user_test.rb
CHANGED
@@ -116,23 +116,21 @@ class UserTest < Test::Unit::TestCase
|
|
116
116
|
assert u.save
|
117
117
|
end
|
118
118
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
# assert !u.save
|
135
|
-
# end
|
119
|
+
def test_create__validates_unique_login
|
120
|
+
u = User.new
|
121
|
+
u.login = users(:tesla).login
|
122
|
+
u.email = 'new@example.com'
|
123
|
+
u.change_password("password")
|
124
|
+
assert !u.save
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_create__validates_unique_email
|
128
|
+
u = User.new
|
129
|
+
u.login = 'new_user'
|
130
|
+
u.email= users(:tesla).email
|
131
|
+
u.change_password("password")
|
132
|
+
assert !u.save
|
133
|
+
end
|
136
134
|
|
137
135
|
def test_find_by
|
138
136
|
user = User.find_by_email('tesla@example.com')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backlog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Uwe Kubosch
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-02-
|
12
|
+
date: 2008-02-25 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- app/views/work_locks/show.rhtml
|
118
118
|
- app/views/work_accounts
|
119
119
|
- app/views/work_accounts/new.rhtml
|
120
|
+
- app/views/work_accounts/_title.rhtml
|
120
121
|
- app/views/work_accounts/list.rhtml
|
121
122
|
- app/views/work_accounts/edit.rhtml
|
122
123
|
- app/views/work_accounts/_form.rhtml
|
@@ -149,6 +150,7 @@ files:
|
|
149
150
|
- app/views/works/list.rhtml
|
150
151
|
- app/views/works/_row.rhtml
|
151
152
|
- app/views/works/list_excel.rhtml
|
153
|
+
- app/views/works/daily_work_sheet_old.rhtml
|
152
154
|
- app/views/works/_buttons.rhtml
|
153
155
|
- app/views/works/timeliste.rhtml
|
154
156
|
- app/views/works/_description_list.rhtml
|
@@ -182,6 +184,7 @@ files:
|
|
182
184
|
- app/views/customers/list.rhtml
|
183
185
|
- app/views/customers/edit.rhtml
|
184
186
|
- app/views/customers/_form.rhtml
|
187
|
+
- app/views/customers/_name_list.rhtml
|
185
188
|
- app/views/customers/show.rhtml
|
186
189
|
- app/views/user
|
187
190
|
- app/views/user/logout.rhtml
|
@@ -255,6 +258,7 @@ files:
|
|
255
258
|
- app/models/task_file.rb
|
256
259
|
- app/models/work_lock.rb
|
257
260
|
- app/models/work_account.rb
|
261
|
+
- no_test.rb~
|
258
262
|
- lang
|
259
263
|
- lang/no.yaml
|
260
264
|
- lang/localizations.yaml
|
@@ -286,6 +290,7 @@ files:
|
|
286
290
|
- test/unit/work_lock_subscription_test.rb
|
287
291
|
- test/unit/period_test.rb
|
288
292
|
- test/unit/estimate_test.rb
|
293
|
+
- test/unit/party_test.rb
|
289
294
|
- test/unit/big_decimal_yaml_fix_test.rb
|
290
295
|
- test/unit/customer_test.rb
|
291
296
|
- test/functional
|
@@ -305,6 +310,11 @@ files:
|
|
305
310
|
- test/functional/search_controller_test.rb
|
306
311
|
- test/integration
|
307
312
|
- test/integration/user_system_test.rb
|
313
|
+
- test/client
|
314
|
+
- test/client/login_test.rb
|
315
|
+
- test/client/setup.rb
|
316
|
+
- test/client/login.rb
|
317
|
+
- test/client/login.rb~
|
308
318
|
- test/mocks
|
309
319
|
- test/mocks/development
|
310
320
|
- test/mocks/test
|