ruboss4ruby 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Generators +5 -0
- data/Manifest.txt +39 -41
- data/Rakefile +2 -1
- data/lib/ruboss4ruby.rb +16 -12
- data/lib/ruboss4ruby/active_foo.rb +39 -3
- data/lib/ruboss4ruby/recipes.rb +62 -0
- data/lib/ruboss4ruby/ruboss_helper.rb +54 -0
- data/lib/ruboss4ruby/ruboss_test_helpers.rb +31 -0
- data/lib/ruboss4ruby/tasks.rb +0 -2
- data/lib/ruboss4ruby/version.rb +2 -2
- data/merb_generators/ruboss_config.rb +19 -19
- data/merb_generators/ruboss_controller.rb +3 -3
- data/merb_generators/ruboss_flex_app.rb +3 -3
- data/merb_generators/ruboss_resource_controller.rb +3 -3
- data/merb_generators/ruboss_scaffold.rb +47 -47
- data/rails_generators/ruboss_config/ruboss_config_generator.rb +2 -2
- data/rails_generators/ruboss_config/templates/index.html.erb +2 -2
- data/rails_generators/ruboss_config/templates/mainapp-config.xml +21 -0
- data/rails_generators/ruboss_config/templates/mainapp.mxml +4 -7
- data/rails_generators/ruboss_config/templates/project-textmate.erb +52 -0
- data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +0 -2
- data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +0 -2
- data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +4 -3
- data/rails_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +0 -1
- data/test/controllers/application.rb +15 -0
- data/test/controllers/locations_controller.rb +93 -0
- data/test/controllers/notes_controller.rb +96 -0
- data/test/controllers/projects_controller.rb +93 -0
- data/test/controllers/tasks_controller.rb +93 -0
- data/test/controllers/users_controller.rb +93 -0
- data/test/database.yml +4 -0
- data/test/fixtures/locations.yml +8 -0
- data/test/fixtures/notes.yml +17 -0
- data/test/fixtures/projects.yml +25 -0
- data/test/fixtures/tasks.yml +46 -0
- data/test/fixtures/users.yml +13 -0
- data/test/helpers/controllers.log +8 -0
- data/test/helpers/functional_test_helper.rb +32 -0
- data/test/helpers/models.log +170 -0
- data/test/helpers/test_helper.rb +25 -0
- data/test/helpers/unit_test_helper.rb +23 -0
- data/test/model.yml +35 -0
- data/test/models/location.rb +4 -0
- data/test/models/note.rb +3 -0
- data/test/models/project.rb +6 -0
- data/test/models/task.rb +20 -0
- data/test/models/user.rb +23 -0
- data/test/playing_around_in_a_console.txt +71 -0
- data/test/schema.rb +63 -0
- data/test/test.sqlite3 +0 -0
- data/test/test.swf +1 -0
- data/test/test_active_foo.rb +79 -0
- data/test/test_ruboss_rails_integration_functional.rb +27 -0
- data/test/test_swfobject_helper.rb +63 -0
- data/test/to_fxml_test.rb +79 -0
- data/test/views/notes/empty_params_action.html.erb +1 -0
- data/test/views/notes/index.html.erb +1 -0
- metadata +57 -52
- data/merb_generators/ruboss_config/USAGE +0 -18
- data/merb_generators/ruboss_config/ruboss_config_generator.rb +0 -135
- data/merb_generators/ruboss_config/templates/actionscript.properties +0 -16
- data/merb_generators/ruboss_config/templates/actionscriptair.properties +0 -16
- data/merb_generators/ruboss_config/templates/expressInstall.swf +0 -0
- data/merb_generators/ruboss_config/templates/flex.properties +0 -2
- data/merb_generators/ruboss_config/templates/html-template/AC_OETags.js +0 -276
- data/merb_generators/ruboss_config/templates/html-template/history/history.css +0 -6
- data/merb_generators/ruboss_config/templates/html-template/history/history.js +0 -645
- data/merb_generators/ruboss_config/templates/html-template/history/historyFrame.html +0 -29
- data/merb_generators/ruboss_config/templates/html-template/index.template.html +0 -121
- data/merb_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
- data/merb_generators/ruboss_config/templates/index.html.erb +0 -18
- data/merb_generators/ruboss_config/templates/mainair-app.xml +0 -134
- data/merb_generators/ruboss_config/templates/mainapp.mxml +0 -34
- data/merb_generators/ruboss_config/templates/project.properties +0 -18
- data/merb_generators/ruboss_config/templates/projectair.properties +0 -24
- data/merb_generators/ruboss_config/templates/swfobject.js +0 -5
- data/merb_generators/ruboss_controller/USAGE +0 -11
- data/merb_generators/ruboss_controller/ruboss_controller_generator.rb +0 -32
- data/merb_generators/ruboss_resource_controller/USAGE +0 -5
- data/merb_generators/ruboss_resource_controller/ruboss_resource_controller_generator.rb +0 -70
- data/merb_generators/ruboss_resource_controller/templates/app/controllers/%controller_file_name%.rb +0 -55
- data/merb_generators/ruboss_resource_controller/templates/app/helpers/%controller_file_name%_helper.rb +0 -16
- data/merb_generators/ruboss_scaffold/USAGE +0 -5
- data/merb_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +0 -127
- data/merb_generators/ruboss_yaml_scaffold/USAGE +0 -5
- data/merb_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +0 -53
- data/merb_generators/templates/ruboss_scaffold/component.mxml.erb +0 -148
- data/merb_generators/templates/ruboss_scaffold/fixtures.yml.erb +0 -35
- data/merb_generators/templates/ruboss_scaffold/migration.rb.erb +0 -19
- data/merb_generators/templates/ruboss_scaffold/model.as.erb +0 -42
- data/merb_generators/templates/ruboss_scaffold/model.rb.erb +0 -11
- data/test/active_foo_test.rb +0 -16
- data/test/test_generator_helper.rb +0 -29
- data/test/test_helper.rb +0 -2
- data/test/test_ruboss_config_generator.rb +0 -45
- data/test/test_ruboss_controller_generator.rb +0 -45
- data/test/test_ruboss_on_ruby.rb +0 -11
- data/test/test_ruboss_scaffold_generator.rb +0 -45
- data/test/test_ruboss_yaml_scaffold_generator.rb +0 -46
@@ -0,0 +1,13 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
|
3
|
+
ludwig:
|
4
|
+
login: ludwig
|
5
|
+
first_name: Ludwig
|
6
|
+
last_name: van Beethoven
|
7
|
+
email: ludwig@vienna.de
|
8
|
+
|
9
|
+
shakespeare:
|
10
|
+
login: william
|
11
|
+
first_name: William
|
12
|
+
last_name: Shakespeare
|
13
|
+
email: will@theglobetheater.com
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Logfile created on Thu Oct 16 14:02:21 -0700 2008 by /
|
2
|
+
|
3
|
+
|
4
|
+
Processing NotesController#empty_params_action (for 0.0.0.0 at 2008-10-16 14:02:22) [GET]
|
5
|
+
Session ID:
|
6
|
+
Parameters: {"action"=>"empty_params_action", "controller"=>"notes"}
|
7
|
+
Rendering notes/empty_params_action
|
8
|
+
Completed in 0.00249 (401 reqs/sec) | Rendering: 0.00061 (24%) | DB: 0.08283 (3327%) | 200 OK [http://test.host/notes/empty_params_action]
|
@@ -0,0 +1,32 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__) + '/../..')
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
3
|
+
schema_file = File.join(File.dirname(__FILE__), '..', 'schema.rb')
|
4
|
+
ENV["RAILS_ENV"] = "test"
|
5
|
+
|
6
|
+
require File.join(File.dirname(__FILE__), '..', 'controllers', 'application')
|
7
|
+
require File.join(File.dirname(__FILE__), '..', 'controllers', 'notes_controller')
|
8
|
+
|
9
|
+
|
10
|
+
config = YAML::load(IO.read(File.join(File.dirname(__FILE__), '..', 'database.yml')))['test']
|
11
|
+
puts "config:\n#{config.inspect}"
|
12
|
+
ActiveRecord::Base.configurations = config
|
13
|
+
ActiveRecord::Base.establish_connection(config)
|
14
|
+
|
15
|
+
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/models.log")
|
16
|
+
ActionController::Base.logger = Logger.new(File.dirname(__FILE__) + "/controllers.log")
|
17
|
+
ApplicationController.append_view_path File.join(File.dirname(__FILE__), '..', 'views')
|
18
|
+
|
19
|
+
load(schema_file) if File.exist?(schema_file)
|
20
|
+
|
21
|
+
Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
|
22
|
+
$:.unshift(Test::Unit::TestCase.fixture_path)
|
23
|
+
|
24
|
+
class Test::Unit::TestCase
|
25
|
+
# Turn off transactional fixtures if you're working with MyISAM tables in MySQL
|
26
|
+
self.use_transactional_fixtures = true
|
27
|
+
|
28
|
+
# Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
|
29
|
+
self.use_instantiated_fixtures = true
|
30
|
+
|
31
|
+
# Add more helper methods to be used by all tests here...
|
32
|
+
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
# Logfile created on Thu Oct 16 14:02:21 -0700 2008 by /
|
2
|
+
[4;36;1mSQL (0.000136)[0m [0;1mselect sqlite_version(*)[0m
|
3
|
+
[4;35;1mSQL (0.000544)[0m [0m SELECT name
|
4
|
+
FROM sqlite_master
|
5
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
6
|
+
[0m
|
7
|
+
[4;36;1mSQL (0.003489)[0m [0;1mDROP TABLE "locations"[0m
|
8
|
+
[4;35;1mSQL (0.003352)[0m [0mCREATE TABLE "locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
9
|
+
[4;36;1mSQL (0.000528)[0m [0;1m SELECT name
|
10
|
+
FROM sqlite_master
|
11
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
12
|
+
[0m
|
13
|
+
[4;35;1mSQL (0.002767)[0m [0mDROP TABLE "notes"[0m
|
14
|
+
[4;36;1mSQL (0.003052)[0m [0;1mCREATE TABLE "notes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "content" text, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
15
|
+
[4;35;1mSQL (0.000524)[0m [0m SELECT name
|
16
|
+
FROM sqlite_master
|
17
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
18
|
+
[0m
|
19
|
+
[4;36;1mSQL (0.002682)[0m [0;1mDROP TABLE "projects"[0m
|
20
|
+
[4;35;1mSQL (0.002528)[0m [0mCREATE TABLE "projects" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "start_date" date, "end_date" date, "completed" boolean, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
21
|
+
[4;36;1mSQL (0.000469)[0m [0;1m SELECT name
|
22
|
+
FROM sqlite_master
|
23
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
24
|
+
[0m
|
25
|
+
[4;35;1mSQL (0.002171)[0m [0mDROP TABLE "tasks"[0m
|
26
|
+
[4;36;1mSQL (0.002067)[0m [0;1mCREATE TABLE "tasks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "start_time" datetime, "end_time" datetime, "completed" boolean, "next_action" boolean, "project_id" integer, "location_id" integer, "user_id" integer, "created_at" datetime, "updated_at" datetime) [0m
|
27
|
+
[4;35;1mSQL (0.000519)[0m [0m SELECT name
|
28
|
+
FROM sqlite_master
|
29
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
30
|
+
[0m
|
31
|
+
[4;36;1mSQL (0.002239)[0m [0;1mDROP TABLE "users"[0m
|
32
|
+
[4;35;1mSQL (0.002673)[0m [0mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "login" varchar(255), "first_name" varchar(255), "last_name" varchar(255), "email" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
33
|
+
[4;36;1mSQL (0.000588)[0m [0;1m SELECT name
|
34
|
+
FROM sqlite_master
|
35
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
36
|
+
[0m
|
37
|
+
[4;35;1mSQL (0.000243)[0m [0mSELECT version FROM "schema_migrations"[0m
|
38
|
+
Unable to load location, underlying cause no such file to load -- location.rb
|
39
|
+
|
40
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
|
41
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
|
42
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
43
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
|
44
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
|
45
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
|
46
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
|
47
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
|
48
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
|
49
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
|
50
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
|
51
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
|
52
|
+
./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
|
53
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
|
54
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
|
55
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
56
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
57
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
58
|
+
-e:1
|
59
|
+
Unable to load note, underlying cause no such file to load -- note.rb
|
60
|
+
|
61
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
|
62
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
|
63
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
64
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
|
65
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
|
66
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
|
67
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
|
68
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
|
69
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
|
70
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
|
71
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
|
72
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
|
73
|
+
./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
|
74
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
|
75
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
|
76
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
77
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
78
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
79
|
+
-e:1
|
80
|
+
Unable to load project, underlying cause no such file to load -- project.rb
|
81
|
+
|
82
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
|
83
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
|
84
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
85
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
|
86
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
|
87
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
|
88
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
|
89
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
|
90
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
|
91
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
|
92
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
|
93
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
|
94
|
+
./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
|
95
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
|
96
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
|
97
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
98
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
99
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
100
|
+
-e:1
|
101
|
+
Unable to load task, underlying cause no such file to load -- task.rb
|
102
|
+
|
103
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
|
104
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
|
105
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
106
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
|
107
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
|
108
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
|
109
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
|
110
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
|
111
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
|
112
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
|
113
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
|
114
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
|
115
|
+
./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
|
116
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
|
117
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
|
118
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
119
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
120
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
121
|
+
-e:1
|
122
|
+
Unable to load user, underlying cause no such file to load -- user.rb
|
123
|
+
|
124
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_without_new_constant_marking'
|
125
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:216:in `load_file'
|
126
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
127
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:215:in `load_file'
|
128
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:96:in `require_or_load'
|
129
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:61:in `depend_on'
|
130
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:457:in `require_dependency'
|
131
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:855:in `try_to_load_dependency'
|
132
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:870:in `require_fixture_classes'
|
133
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `each'
|
134
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:867:in `require_fixture_classes'
|
135
|
+
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/fixtures.rb:850:in `fixtures'
|
136
|
+
./test/helpers/../../test/test_ruboss_rails_integration_functional.rb:14
|
137
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
|
138
|
+
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
|
139
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
140
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'
|
141
|
+
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'
|
142
|
+
-e:1
|
143
|
+
[4;36;1mUser Load (0.000228)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
144
|
+
[4;35;1mUser Load (0.000159)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
145
|
+
[4;36;1mProject Load (0.000184)[0m [0;1mSELECT * FROM "projects" WHERE ("projects"."id" = 342996156) [0m
|
146
|
+
[4;35;1mTask Load (0.000347)[0m [0mSELECT * FROM "tasks" WHERE ("tasks".project_id = 342996156) [0m
|
147
|
+
[4;36;1mUser Load (0.000156)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
148
|
+
[4;35;1mProject Load (0.000179)[0m [0mSELECT * FROM "projects" WHERE ("projects"."id" = 342996156) [0m
|
149
|
+
[4;36;1mUser Load (0.000169)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 875057608) [0m
|
150
|
+
[4;35;1mTask Load (0.000322)[0m [0mSELECT * FROM "tasks" WHERE ("tasks".project_id = 342996156) [0m
|
151
|
+
[4;36;1mUser Load (0.000159)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
152
|
+
[4;35;1mTask Load (0.000216)[0m [0mSELECT * FROM "tasks" WHERE ("tasks"."id" = 121780552) [0m
|
153
|
+
[4;36;1mUser Load (0.000157)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
154
|
+
[4;35;1mUser Load (0.000160)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
155
|
+
[4;36;1mUser Load (0.000156)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
156
|
+
[4;35;1mUser Load (0.000168)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 875057608) [0m
|
157
|
+
[4;36;1mTask Load (0.000728)[0m [0;1mSELECT * FROM "tasks" WHERE ("tasks".user_id = 875057608) [0m
|
158
|
+
[4;35;1mProject Load (0.000314)[0m [0mSELECT * FROM "projects" WHERE ("projects".user_id = 875057608) [0m
|
159
|
+
[4;36;1mUser Load (0.000157)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
160
|
+
[4;35;1mUser Load (0.000161)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 875057608) [0m
|
161
|
+
[4;36;1mTask Load (0.000514)[0m [0;1mSELECT * FROM "tasks" WHERE ("tasks".user_id = 875057608) [0m
|
162
|
+
[4;35;1mProject Load (0.000296)[0m [0mSELECT * FROM "projects" WHERE ("projects".user_id = 875057608) [0m
|
163
|
+
[4;36;1mUser Load (0.000160)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
164
|
+
[4;35;1mUser Load (0.000163)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 875057608) [0m
|
165
|
+
[4;36;1mTask Load (0.000504)[0m [0;1mSELECT * FROM "tasks" WHERE ("tasks".user_id = 875057608) [0m
|
166
|
+
[4;35;1mProject Load (0.000280)[0m [0mSELECT * FROM "projects" WHERE ("projects".user_id = 875057608) [0m
|
167
|
+
[4;36;1mUser Load (0.000158)[0m [0;1mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
168
|
+
[4;35;1mUser Load (0.000158)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 22086222) [0m
|
169
|
+
[4;36;1mTask Load (0.000346)[0m [0;1mSELECT * FROM "tasks" WHERE ("tasks".user_id = 22086222) [0m
|
170
|
+
[4;35;1mProject Load (0.000295)[0m [0mSELECT * FROM "projects" WHERE ("projects".user_id = 22086222) [0m
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
RAILS_ROOT = File.join(File.dirname(__FILE__), '..') unless defined? RAILS_ROOT
|
3
|
+
require 'rubygems'
|
4
|
+
|
5
|
+
require 'test/unit'
|
6
|
+
require 'active_support'
|
7
|
+
require 'active_support/test_case'
|
8
|
+
require 'active_record'
|
9
|
+
require 'active_record/fixtures'
|
10
|
+
require 'action_controller'
|
11
|
+
require 'action_controller/test_case'
|
12
|
+
require 'action_controller/assertions'
|
13
|
+
require 'action_controller/test_process'
|
14
|
+
require 'action_controller/integration'
|
15
|
+
require 'sqlite3'
|
16
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'ruboss4ruby')
|
17
|
+
require File.join(File.dirname(__FILE__), '..', 'models', 'note')
|
18
|
+
require File.join(File.dirname(__FILE__), '..', 'models', 'user')
|
19
|
+
require File.join(File.dirname(__FILE__), '..', 'models', 'project')
|
20
|
+
require File.join(File.dirname(__FILE__), '..', 'models', 'location')
|
21
|
+
require File.join(File.dirname(__FILE__), '..', 'models', 'task')
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__) + '/../..')
|
2
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
3
|
+
schema_file = File.join(File.dirname(__FILE__), '..', 'schema.rb')
|
4
|
+
|
5
|
+
|
6
|
+
config = YAML::load(IO.read(File.join(File.dirname(__FILE__), '..', 'database.yml')))[ENV['DB'] || 'test']
|
7
|
+
ActiveRecord::Base.configurations = config
|
8
|
+
ActiveRecord::Base.establish_connection(config)
|
9
|
+
|
10
|
+
load(schema_file) if File.exist?(schema_file)
|
11
|
+
|
12
|
+
Test::Unit::TestCase.fixture_path = File.join(File.dirname(__FILE__), '..', 'fixtures')
|
13
|
+
$:.unshift(Test::Unit::TestCase.fixture_path)
|
14
|
+
|
15
|
+
class Test::Unit::TestCase #:nodoc:
|
16
|
+
# Turn off transactional fixtures if you're working with MyISAM tables in MySQL
|
17
|
+
self.use_transactional_fixtures = true
|
18
|
+
|
19
|
+
# Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david)
|
20
|
+
self.use_instantiated_fixtures = true
|
21
|
+
|
22
|
+
# Add more helper methods to be used by all tests here...
|
23
|
+
end
|
data/test/model.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
project:
|
2
|
+
- name: string
|
3
|
+
- notes: text
|
4
|
+
- start_date: date
|
5
|
+
- end_date: date
|
6
|
+
- completed: boolean
|
7
|
+
- belongs_to: [user]
|
8
|
+
- has_many: [tasks]
|
9
|
+
|
10
|
+
location:
|
11
|
+
- name: string
|
12
|
+
- notes: text
|
13
|
+
- belongs_to: [user]
|
14
|
+
- has_many: [tasks]
|
15
|
+
|
16
|
+
task:
|
17
|
+
- name: string
|
18
|
+
- notes: text
|
19
|
+
- start_time: datetime
|
20
|
+
- end_time: datetime
|
21
|
+
- completed: boolean
|
22
|
+
- next_action: boolean
|
23
|
+
- belongs_to: [project, location, user]
|
24
|
+
|
25
|
+
note:
|
26
|
+
- content: text
|
27
|
+
- belongs_to: [user]
|
28
|
+
|
29
|
+
user:
|
30
|
+
- login: string
|
31
|
+
- first_name: string
|
32
|
+
- last_name: string
|
33
|
+
- email: string
|
34
|
+
- has_many: [tasks, projects, locations]
|
35
|
+
- has_one: [note]
|
data/test/models/note.rb
ADDED
data/test/models/task.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
class Task < ActiveRecord::Base
|
2
|
+
belongs_to :project
|
3
|
+
belongs_to :location
|
4
|
+
belongs_to :user
|
5
|
+
|
6
|
+
default_fxml_methods :is_active
|
7
|
+
|
8
|
+
def is_active
|
9
|
+
case
|
10
|
+
when start_time && end_time
|
11
|
+
(start_time .. end_time) === Time.now
|
12
|
+
when start_time && end_time.nil?
|
13
|
+
start_time <= Time.now
|
14
|
+
when start_time.nil && end_time
|
15
|
+
end_time >= Time.now
|
16
|
+
else
|
17
|
+
true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/test/models/user.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
class User < ActiveRecord::Base
|
2
|
+
has_one :note
|
3
|
+
has_many :tasks
|
4
|
+
has_many :projects
|
5
|
+
has_many :locations
|
6
|
+
|
7
|
+
default_fxml_methods :full_name, :has_nothing_to_do
|
8
|
+
default_fxml_includes :tasks, :projects
|
9
|
+
|
10
|
+
validates_length_of :login, :maximum => 10
|
11
|
+
|
12
|
+
def full_name
|
13
|
+
"#{first_name} #{last_name}"
|
14
|
+
end
|
15
|
+
|
16
|
+
def has_nothing_to_do
|
17
|
+
tasks.all? {|task| task.completed}
|
18
|
+
end
|
19
|
+
|
20
|
+
def email_host
|
21
|
+
email.split('@').last
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
To play with the test models in a console, do this:
|
2
|
+
|
3
|
+
$> irb -r test/helpers/test_helper.rb -r test/helpers/unit_test_helper.rb
|
4
|
+
|
5
|
+
You can then do things like this:
|
6
|
+
|
7
|
+
$> irb -r test/helpers/test_helper.rb -r test/helpers/unit_test_helper.rb
|
8
|
+
-- create_table("locations", {:force=>true})
|
9
|
+
-> 0.0170s
|
10
|
+
-- create_table("notes", {:force=>true})
|
11
|
+
-> 0.0091s
|
12
|
+
-- create_table("projects", {:force=>true})
|
13
|
+
-> 0.0091s
|
14
|
+
-- create_table("tasks", {:force=>true})
|
15
|
+
-> 0.0098s
|
16
|
+
-- create_table("users", {:force=>true})
|
17
|
+
-> 0.0506s
|
18
|
+
-- initialize_schema_migrations_table()
|
19
|
+
-> 0.0010s
|
20
|
+
-- assume_migrated_upto_version(20080729045550)
|
21
|
+
-> 0.0009s
|
22
|
+
>> u = User.create(:login => 'spatten')
|
23
|
+
=> #<User id: 1, login: "spatten", first_name: nil, last_name: nil, email: nil, created_at: "2008-10-15 17:29:36", updated_at: "2008-10-15 17:29:36">
|
24
|
+
>> u.tasks << Task.create
|
25
|
+
=> [#<Task id: 1, name: nil, notes: nil, start_time: nil, end_time: nil, completed: nil, next_action: nil, project_id: nil, location_id: nil, user_id: 1, created_at: "2008-10-15 17:29:48", updated_at: "2008-10-15 17:29:48">]
|
26
|
+
>> u.projects << Project.create
|
27
|
+
=> [#<Project id: 1, name: nil, notes: nil, start_date: nil, end_date: nil, completed: nil, user_id: 1, created_at: "2008-10-15 17:29:54", updated_at: "2008-10-15 17:29:54">]
|
28
|
+
>> puts u.to_fxml
|
29
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
30
|
+
<user>
|
31
|
+
<created_at type="datetime">2008/10/15 17:29:36</created_at>
|
32
|
+
<email nil="true"></email>
|
33
|
+
<first_name nil="true"></first_name>
|
34
|
+
<id type="integer">1</id>
|
35
|
+
<last_name nil="true"></last_name>
|
36
|
+
<login>spatten</login>
|
37
|
+
<updated_at type="datetime">2008/10/15 17:29:36</updated_at>
|
38
|
+
<full_name> </full_name>
|
39
|
+
<has_nothing_to_do type="boolean">false</has_nothing_to_do>
|
40
|
+
<tasks type="array">
|
41
|
+
<task>
|
42
|
+
<completed type="boolean" nil="true"></completed>
|
43
|
+
<created_at type="datetime">2008/10/15 17:29:48</created_at>
|
44
|
+
<end_time type="datetime" nil="true"></end_time>
|
45
|
+
<id type="integer">1</id>
|
46
|
+
<location_id type="integer" nil="true"></location_id>
|
47
|
+
<name nil="true"></name>
|
48
|
+
<next_action type="boolean" nil="true"></next_action>
|
49
|
+
<notes nil="true"></notes>
|
50
|
+
<project_id type="integer" nil="true"></project_id>
|
51
|
+
<start_time type="datetime" nil="true"></start_time>
|
52
|
+
<updated_at type="datetime">2008/10/15 17:29:48</updated_at>
|
53
|
+
<user_id type="integer">1</user_id>
|
54
|
+
</task>
|
55
|
+
</tasks>
|
56
|
+
<projects type="array">
|
57
|
+
<project>
|
58
|
+
<completed type="boolean" nil="true"></completed>
|
59
|
+
<created_at type="datetime">2008/10/15 17:29:54</created_at>
|
60
|
+
<end_date type="date" nil="true"></end_date>
|
61
|
+
<id type="integer">1</id>
|
62
|
+
<name nil="true"></name>
|
63
|
+
<notes nil="true"></notes>
|
64
|
+
<start_date type="date" nil="true"></start_date>
|
65
|
+
<updated_at type="datetime">2008/10/15 17:29:54</updated_at>
|
66
|
+
<user_id type="integer">1</user_id>
|
67
|
+
</project>
|
68
|
+
</projects>
|
69
|
+
</user>
|
70
|
+
=> nil
|
71
|
+
>>
|