report_ui 0.0.1.alpha

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.
Files changed (154) hide show
  1. data/.bundle/config +2 -0
  2. data/.config/cucumber.yml +8 -0
  3. data/.gitignore +6 -0
  4. data/.gitkeep +0 -0
  5. data/Gemfile +28 -0
  6. data/Gemfile.lock +159 -0
  7. data/MIT-LICENSE +20 -0
  8. data/README +13 -0
  9. data/Rakefile +78 -0
  10. data/VERSION +1 -0
  11. data/features/reports.feature +45 -0
  12. data/features/step_definitions/bernie_steps.rb +5 -0
  13. data/features/step_definitions/mislav_steps.rb +13 -0
  14. data/features/step_definitions/web_steps.rb +226 -0
  15. data/features/support/blueprints.rb +13 -0
  16. data/features/support/env.rb +39 -0
  17. data/features/support/models.rb +7 -0
  18. data/features/support/paths.rb +41 -0
  19. data/fixture_rails_root/.gitignore +4 -0
  20. data/fixture_rails_root/Gemfile +25 -0
  21. data/fixture_rails_root/Gemfile.lock +177 -0
  22. data/fixture_rails_root/README +256 -0
  23. data/fixture_rails_root/Rakefile +7 -0
  24. data/fixture_rails_root/app/controllers/application_controller.rb +3 -0
  25. data/fixture_rails_root/app/helpers/application_helper.rb +2 -0
  26. data/fixture_rails_root/app/views/layouts/application.html.erb +14 -0
  27. data/fixture_rails_root/config.ru +4 -0
  28. data/fixture_rails_root/config/application.rb +16 -0
  29. data/fixture_rails_root/config/boot.rb +13 -0
  30. data/fixture_rails_root/config/database.yml +28 -0
  31. data/fixture_rails_root/config/environment.rb +5 -0
  32. data/fixture_rails_root/config/environments/development.rb +11 -0
  33. data/fixture_rails_root/config/environments/production.rb +9 -0
  34. data/fixture_rails_root/config/environments/test.rb +10 -0
  35. data/fixture_rails_root/config/initializers/backtrace_silencers.rb +7 -0
  36. data/fixture_rails_root/config/initializers/inflections.rb +10 -0
  37. data/fixture_rails_root/config/initializers/mime_types.rb +5 -0
  38. data/fixture_rails_root/config/initializers/report_ui.rb +1 -0
  39. data/fixture_rails_root/config/initializers/secret_token.rb +7 -0
  40. data/fixture_rails_root/config/initializers/session_store.rb +2 -0
  41. data/fixture_rails_root/config/locales/en.yml +5 -0
  42. data/fixture_rails_root/config/routes.rb +3 -0
  43. data/fixture_rails_root/db/schema.rb +30 -0
  44. data/fixture_rails_root/db/seeds.rb +7 -0
  45. data/fixture_rails_root/doc/README_FOR_APP +2 -0
  46. data/fixture_rails_root/lib/tasks/.gitkeep +0 -0
  47. data/fixture_rails_root/public/404.html +26 -0
  48. data/fixture_rails_root/public/422.html +26 -0
  49. data/fixture_rails_root/public/500.html +26 -0
  50. data/fixture_rails_root/public/favicon.ico +0 -0
  51. data/fixture_rails_root/public/images/rails.png +0 -0
  52. data/fixture_rails_root/public/index.html +239 -0
  53. data/fixture_rails_root/public/javascripts/application.js +2 -0
  54. data/fixture_rails_root/public/javascripts/controls.js +965 -0
  55. data/fixture_rails_root/public/javascripts/dragdrop.js +974 -0
  56. data/fixture_rails_root/public/javascripts/effects.js +1123 -0
  57. data/fixture_rails_root/public/javascripts/prototype.js +6001 -0
  58. data/fixture_rails_root/public/javascripts/rails.js +175 -0
  59. data/fixture_rails_root/public/robots.txt +5 -0
  60. data/fixture_rails_root/public/stylesheets/.gitkeep +0 -0
  61. data/fixture_rails_root/script/rails +6 -0
  62. data/fixture_rails_root/test/performance/browsing_test.rb +9 -0
  63. data/fixture_rails_root/test/test_helper.rb +13 -0
  64. data/generators/USAGE +8 -0
  65. data/generators/reporter_generator.rb +3 -0
  66. data/init.rb +3 -0
  67. data/install.rb +2 -0
  68. data/lib/app/controllers/reports_controller.rb +32 -0
  69. data/lib/app/models/report.rb +36 -0
  70. data/lib/app/views/layouts/reports.html.haml +11 -0
  71. data/lib/app/views/reports/_columns_editor.html.haml +14 -0
  72. data/lib/app/views/reports/_details.html.haml +5 -0
  73. data/lib/app/views/reports/_form.html.haml +2 -0
  74. data/lib/app/views/reports/_report_details_edit.html.haml +11 -0
  75. data/lib/app/views/reports/_reports_table.html.haml +10 -0
  76. data/lib/app/views/reports/edit.html.haml +2 -0
  77. data/lib/app/views/reports/index.html.haml +19 -0
  78. data/lib/app/views/reports/new.html.haml +38 -0
  79. data/lib/app/views/reports/show.html.haml +13 -0
  80. data/lib/app/views/reports/show.js.erb +1 -0
  81. data/lib/config/.routes.rb.swn +0 -0
  82. data/lib/config/routes.rb +7 -0
  83. data/lib/report_ui.rb +9 -0
  84. data/lib/report_ui/engine.rb +13 -0
  85. data/lib/report_ui/orm/active_record.rb +24 -0
  86. data/lib/report_ui/routing.rb +13 -0
  87. data/lib/report_ui/schema.rb +17 -0
  88. data/lib/tasks/report_ui_tasks.rake +4 -0
  89. data/public/javascripts/.gitkeep +0 -0
  90. data/public/javascripts/application.js +63 -0
  91. data/public/javascripts/jquery-ui.min.js +778 -0
  92. data/public/javascripts/jquery.js +154 -0
  93. data/public/javascripts/jrails.min.js +1 -0
  94. data/public/javascripts/report_ui/application.js +63 -0
  95. data/public/javascripts/report_ui/jquery-ui.min.js +778 -0
  96. data/public/javascripts/report_ui/jquery.js +154 -0
  97. data/public/javascripts/report_ui/jrails.min.js +1 -0
  98. data/public/stylesheets/.gitkeep +0 -0
  99. data/public/stylesheets/formtastic.css +214 -0
  100. data/public/stylesheets/formtastic_changes.css +8 -0
  101. data/public/stylesheets/ie.css +89 -0
  102. data/public/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  103. data/public/stylesheets/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  104. data/public/stylesheets/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  105. data/public/stylesheets/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  106. data/public/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  107. data/public/stylesheets/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  108. data/public/stylesheets/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  109. data/public/stylesheets/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  110. data/public/stylesheets/images/ui-icons_217bc0_256x240.png +0 -0
  111. data/public/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
  112. data/public/stylesheets/images/ui-icons_469bdd_256x240.png +0 -0
  113. data/public/stylesheets/images/ui-icons_6da8d5_256x240.png +0 -0
  114. data/public/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
  115. data/public/stylesheets/images/ui-icons_d8e7f3_256x240.png +0 -0
  116. data/public/stylesheets/images/ui-icons_f9bd01_256x240.png +0 -0
  117. data/public/stylesheets/jquery-ui.css +572 -0
  118. data/public/stylesheets/print.css +73 -0
  119. data/public/stylesheets/reporter/formtastic.css +214 -0
  120. data/public/stylesheets/reporter/formtastic_changes.css +8 -0
  121. data/public/stylesheets/reporter/ie.css +89 -0
  122. data/public/stylesheets/reporter/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  123. data/public/stylesheets/reporter/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  124. data/public/stylesheets/reporter/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  125. data/public/stylesheets/reporter/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  126. data/public/stylesheets/reporter/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  127. data/public/stylesheets/reporter/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  128. data/public/stylesheets/reporter/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  129. data/public/stylesheets/reporter/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  130. data/public/stylesheets/reporter/images/ui-icons_217bc0_256x240.png +0 -0
  131. data/public/stylesheets/reporter/images/ui-icons_2e83ff_256x240.png +0 -0
  132. data/public/stylesheets/reporter/images/ui-icons_469bdd_256x240.png +0 -0
  133. data/public/stylesheets/reporter/images/ui-icons_6da8d5_256x240.png +0 -0
  134. data/public/stylesheets/reporter/images/ui-icons_cd0a0a_256x240.png +0 -0
  135. data/public/stylesheets/reporter/images/ui-icons_d8e7f3_256x240.png +0 -0
  136. data/public/stylesheets/reporter/images/ui-icons_f9bd01_256x240.png +0 -0
  137. data/public/stylesheets/reporter/jquery-ui.css +572 -0
  138. data/public/stylesheets/reporter/print.css +73 -0
  139. data/public/stylesheets/reporter/screen.css +1271 -0
  140. data/public/stylesheets/screen.css +1271 -0
  141. data/report_ui.gemspec +267 -0
  142. data/spec/controllers/reports_controller_spec.rb +4 -0
  143. data/spec/lib/models_spec.rb +7 -0
  144. data/spec/models/report_spec.rb +50 -0
  145. data/spec/routing/routing_spec.rb +21 -0
  146. data/spec/spec_helper.rb +25 -0
  147. data/spec/support/blueprints.rb +13 -0
  148. data/spec/support/models.rb +7 -0
  149. data/spec/views/reports/index.html.haml_spec.rb +21 -0
  150. data/spec/views/reports/new.html.haml_spec.rb +1 -0
  151. data/spec/views/reports/show.html.haml_spec.rb +10 -0
  152. data/tasks/reporter.rake +34 -0
  153. data/uninstall.rb +1 -0
  154. metadata +551 -0
data/.bundle/config ADDED
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_DISABLE_SHARED_GEMS: "1"
@@ -0,0 +1,8 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
5
+ %>
6
+ default: <%= std_opts %> features
7
+ wip: --tags @wip:3 --wip features
8
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *.swp
2
+ debug.log
3
+ *.db
4
+ app/stylesheets
5
+ pkg/*
6
+ .rvmrc
data/.gitkeep ADDED
File without changes
data/Gemfile ADDED
@@ -0,0 +1,28 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'bundler', '~> 1.0.0'
4
+ gem 'orm_adapter'
5
+ gem 'actionpack', '~> 3.0.0'
6
+ gem 'activesupport', '~> 3.0.0'
7
+ gem 'jeweler', '~> 1.4.0'
8
+ gem 'haml'
9
+ gem 'compass'
10
+ gem 'formtastic'
11
+ gem 'meta_search'
12
+ gem 'decent_exposure', '~> 1.0.0.rc1'
13
+
14
+ group :development, :test do
15
+ gem 'rspec'
16
+ gem 'rspec-core'
17
+ gem 'rspec-expectations'
18
+ gem 'rspec-mocks'
19
+ gem 'rspec-rails'
20
+ gem 'cucumber'
21
+ gem 'cucumber-rails'
22
+ gem 'nokogiri'
23
+ gem 'webrat'
24
+ gem 'capybara'
25
+ gem 'capybara-envjs'
26
+ gem 'ruby-debug'
27
+ gem 'machinist'
28
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,159 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ abstract (1.0.0)
5
+ actionpack (3.0.1)
6
+ activemodel (= 3.0.1)
7
+ activesupport (= 3.0.1)
8
+ builder (~> 2.1.2)
9
+ erubis (~> 2.6.6)
10
+ i18n (~> 0.4.1)
11
+ rack (~> 1.2.1)
12
+ rack-mount (~> 0.6.12)
13
+ rack-test (~> 0.5.4)
14
+ tzinfo (~> 0.3.23)
15
+ activemodel (3.0.1)
16
+ activesupport (= 3.0.1)
17
+ builder (~> 2.1.2)
18
+ i18n (~> 0.4.1)
19
+ activerecord (3.0.1)
20
+ activemodel (= 3.0.1)
21
+ activesupport (= 3.0.1)
22
+ arel (~> 1.0.0)
23
+ tzinfo (~> 0.3.23)
24
+ activesupport (3.0.1)
25
+ arel (1.0.1)
26
+ activesupport (~> 3.0.0)
27
+ builder (2.1.2)
28
+ capybara (0.4.0)
29
+ celerity (>= 0.7.9)
30
+ culerity (>= 0.2.4)
31
+ mime-types (>= 1.16)
32
+ nokogiri (>= 1.3.3)
33
+ rack (>= 1.0.0)
34
+ rack-test (>= 0.5.4)
35
+ selenium-webdriver (>= 0.0.27)
36
+ xpath (~> 0.1.2)
37
+ capybara-envjs (0.4.0)
38
+ capybara (~> 0.4.0)
39
+ envjs (>= 0.3.7)
40
+ celerity (0.8.2)
41
+ childprocess (0.1.3)
42
+ ffi (~> 0.6.3)
43
+ columnize (0.3.1)
44
+ compass (0.10.5)
45
+ haml (>= 3.0.4)
46
+ cucumber (0.9.3)
47
+ builder (~> 2.1.2)
48
+ diff-lcs (~> 1.1.2)
49
+ gherkin (~> 2.2.9)
50
+ json (~> 1.4.6)
51
+ term-ansicolor (~> 1.0.5)
52
+ cucumber-rails (0.3.2)
53
+ cucumber (>= 0.8.0)
54
+ culerity (0.2.12)
55
+ decent_exposure (1.0.0.rc1)
56
+ diff-lcs (1.1.2)
57
+ envjs (0.3.8)
58
+ johnson (>= 2.0.0.pre3)
59
+ erubis (2.6.6)
60
+ abstract (>= 1.0.0)
61
+ ffi (0.6.3)
62
+ rake (>= 0.8.7)
63
+ formtastic (1.1.0)
64
+ actionpack (>= 2.3.0)
65
+ activesupport (>= 2.3.0)
66
+ i18n (>= 0.4.0)
67
+ gemcutter (0.6.1)
68
+ gherkin (2.2.9)
69
+ json (~> 1.4.6)
70
+ term-ansicolor (~> 1.0.5)
71
+ git (1.2.5)
72
+ haml (3.0.22)
73
+ i18n (0.4.1)
74
+ jeweler (1.4.0)
75
+ gemcutter (>= 0.1.0)
76
+ git (>= 1.2.5)
77
+ rubyforge (>= 2.0.0)
78
+ johnson (2.0.0.pre3)
79
+ stackdeck (~> 0.2)
80
+ json (1.4.6)
81
+ json_pure (1.4.6)
82
+ linecache (0.43)
83
+ machinist (1.0.6)
84
+ meta_search (0.9.8)
85
+ actionpack (~> 3.0.0)
86
+ activerecord (~> 3.0.0)
87
+ activesupport (~> 3.0.0)
88
+ arel (~> 1.0.1)
89
+ mime-types (1.16)
90
+ nokogiri (1.4.3.1)
91
+ orm_adapter (0.0.3)
92
+ rack (1.2.1)
93
+ rack-mount (0.6.13)
94
+ rack (>= 1.0.0)
95
+ rack-test (0.5.6)
96
+ rack (>= 1.0)
97
+ rake (0.8.7)
98
+ rspec (2.0.1)
99
+ rspec-core (~> 2.0.1)
100
+ rspec-expectations (~> 2.0.1)
101
+ rspec-mocks (~> 2.0.1)
102
+ rspec-core (2.0.1)
103
+ rspec-expectations (2.0.1)
104
+ diff-lcs (>= 1.1.2)
105
+ rspec-mocks (2.0.1)
106
+ rspec-core (~> 2.0.1)
107
+ rspec-expectations (~> 2.0.1)
108
+ rspec-rails (2.0.1)
109
+ rspec (~> 2.0.0)
110
+ ruby-debug (0.10.3)
111
+ columnize (>= 0.1)
112
+ ruby-debug-base (~> 0.10.3.0)
113
+ ruby-debug-base (0.10.3)
114
+ linecache (>= 0.3)
115
+ rubyforge (2.0.4)
116
+ json_pure (>= 1.1.7)
117
+ rubyzip (0.9.4)
118
+ selenium-webdriver (0.0.29)
119
+ childprocess (>= 0.0.7)
120
+ ffi (~> 0.6.3)
121
+ json_pure
122
+ rubyzip
123
+ stackdeck (0.2.0)
124
+ term-ansicolor (1.0.5)
125
+ tzinfo (0.3.23)
126
+ webrat (0.7.2)
127
+ nokogiri (>= 1.2.0)
128
+ rack (>= 1.0)
129
+ rack-test (>= 0.5.3)
130
+ xpath (0.1.2)
131
+ nokogiri (~> 1.3)
132
+
133
+ PLATFORMS
134
+ ruby
135
+
136
+ DEPENDENCIES
137
+ actionpack (~> 3.0.0)
138
+ activesupport (~> 3.0.0)
139
+ bundler (~> 1.0.0)
140
+ capybara
141
+ capybara-envjs
142
+ compass
143
+ cucumber
144
+ cucumber-rails
145
+ decent_exposure (~> 1.0.0.rc1)
146
+ formtastic
147
+ haml
148
+ jeweler (~> 1.4.0)
149
+ machinist
150
+ meta_search
151
+ nokogiri
152
+ orm_adapter
153
+ rspec
154
+ rspec-core
155
+ rspec-expectations
156
+ rspec-mocks
157
+ rspec-rails
158
+ ruby-debug
159
+ webrat
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,13 @@
1
+ Reporter
2
+ ========
3
+
4
+ Introduction goes here.
5
+
6
+
7
+ Example
8
+ =======
9
+
10
+ Example goes here.
11
+
12
+
13
+ Copyright (c) 2010 [name of plugin creator], released under the MIT license
data/Rakefile ADDED
@@ -0,0 +1,78 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "report_ui"
8
+ gem.summary = %Q{Reporting engine for Rails}
9
+ gem.description = %Q{Reporting engine for rails}
10
+ gem.email = "btelles@gmail.com"
11
+ gem.homepage = "http://github.com/btelles/report_ui"
12
+ gem.authors = ["Bernardo Telles"]
13
+ gem.add_dependency 'bundler', '~> 1.0.0'
14
+ gem.add_dependency 'orm_adapter'
15
+ gem.add_dependency 'actionpack', '~> 3.0.0'
16
+ gem.add_dependency 'activesupport', '~> 3.0.0'
17
+ gem.add_dependency 'jeweler', '~> 1.4.0'
18
+ gem.add_dependency 'haml'
19
+ gem.add_dependency 'compass'
20
+ gem.add_dependency 'formtastic'
21
+ gem.add_dependency 'meta_search'
22
+ gem.add_dependency 'decent_exposure', '~> 1.0.0.rc1'
23
+
24
+ gem.add_development_dependency "rspec", "= 2.0.1"
25
+ gem.add_development_dependency 'rspec-expectations'
26
+ gem.add_development_dependency 'rspec-mocks'
27
+ gem.add_development_dependency 'rspec-rails'
28
+ gem.add_development_dependency 'cucumber'
29
+ gem.add_development_dependency 'cucumber-rails'
30
+ gem.add_development_dependency 'nokogiri'
31
+ gem.add_development_dependency 'webrat'
32
+ gem.add_development_dependency 'capybara'
33
+ gem.add_development_dependency 'capybara-envjs'
34
+ gem.add_development_dependency 'ruby-debug'
35
+ gem.add_development_dependency 'machinist'
36
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
37
+ end
38
+ Jeweler::GemcutterTasks.new
39
+ rescue LoadError
40
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
41
+ end
42
+
43
+ begin
44
+ require 'reek/adapters/rake_task'
45
+ Reek::RakeTask.new do |t|
46
+ t.fail_on_error = true
47
+ t.verbose = false
48
+ t.source_files = 'lib/**/*.rb'
49
+ end
50
+ rescue LoadError
51
+ task :reek do
52
+ abort "Reek is not available. In order to run reek, you must: sudo gem install reek"
53
+ end
54
+ end
55
+
56
+ begin
57
+ require 'roodi'
58
+ require 'roodi_task'
59
+ RoodiTask.new do |t|
60
+ t.verbose = false
61
+ end
62
+ rescue LoadError
63
+ task :roodi do
64
+ abort "Roodi is not available. In order to run roodi, you must: sudo gem install roodi"
65
+ end
66
+ end
67
+
68
+ task :default => :spec
69
+
70
+ require 'rake/rdoctask'
71
+ Rake::RDocTask.new do |rdoc|
72
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
73
+
74
+ rdoc.rdoc_dir = 'rdoc'
75
+ rdoc.title = "rep #{version}"
76
+ rdoc.rdoc_files.include('README*')
77
+ rdoc.rdoc_files.include('lib/**/*.rb')
78
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1.alpha
@@ -0,0 +1,45 @@
1
+ Feature: Manage reports
2
+
3
+ Scenario: Viewing a list of reports
4
+ Given An existing "report" with "name" "Some report"
5
+ And I am on the reports page
6
+ Then I should see "Some report"
7
+
8
+ # Scenario: Editing an existing report
9
+ # Given An existing "report" with "name" "Tommy Test"
10
+ # And with "code" "Person.where('last_name = "tommy"')"
11
+ # And with "description" "My report's description."
12
+ # And I am on the reports page
13
+ # When I press "Tommy Test"
14
+ # Then I should see "Edit"
15
+ # When I press "Edit"
16
+ # Then I should see "Editing Tommy Test"
17
+ # And I should see "Columns"
18
+ # And I should see "Filters"
19
+ # And I should see "Sorts"
20
+
21
+ Scenario: Creating reports
22
+ Given I am on the new report page
23
+ Then I should see "Creating a new report"
24
+ When I fill in "report_name" with "My new report"
25
+ And I follow "Edit" within "#columns"
26
+ And I check "Person_last_name"
27
+ And I press "Ok"
28
+ Then the "Person_last_name" checkbox within "#columns_editor" should be checked
29
+ And I press "Run/Save"
30
+ Then I should see "You've successfully created a report"
31
+
32
+ Scenario: Viewing reports
33
+ Given An existing "report" with "name" "Tommy Test"
34
+ And with "code" "Person.where('last_name = "tommy"')"
35
+ And with "description" "My report's description."
36
+ And An existing "person" with "last_name" "tommy"
37
+ When I go to that report's page
38
+ Then I should see "Tommy Test"
39
+ And I should see "Last name"
40
+ And I should see "tommy" within "table"
41
+ And I should see "My report's description"
42
+
43
+ Scenario: has a new div
44
+ Given I am on the new report page
45
+ Then I should see "hello"
@@ -0,0 +1,5 @@
1
+ When /^(?:|I )click the dialog's Ok button?$/ do
2
+ with_scope('.ui-dialog') do
3
+ click_button("[@class='ui-button-text']")
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ {
2
+ 'in the title' => 'h1, h2, h3',
3
+ 'as a movie title in the results' => 'ol.movies h1',
4
+ 'in a button' => 'button, input[type=submit]',
5
+ 'in the navigation' => 'nav'
6
+ }.
7
+ each do |within, selector|
8
+ Then /^(.+) #{within}$/ do |step|
9
+ with_scope(selector) do
10
+ Then step
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,226 @@
1
+ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
+ # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
+ # files.
6
+
7
+
8
+ require 'uri'
9
+ require 'cgi'
10
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
11
+
12
+ module WithinHelpers
13
+ def with_scope(locator)
14
+ locator ? within(locator) { yield } : yield
15
+ end
16
+ end
17
+ World(WithinHelpers)
18
+ require File.dirname(__FILE__) + '/mislav_steps'
19
+
20
+ Given /^(?:|I )am on (.+)$/ do |page_name|
21
+ visit path_to(page_name)
22
+ end
23
+
24
+ Given /^An? existing "([^"]*)" with "([^"]*)" "([^"]*)"/ do |model, property, value|
25
+ @current = instance_variable_set("@#{model}".to_sym, model.classify.constantize.make(property.to_sym => value))
26
+ end
27
+ Given /^with "([^"]*)" "(.*)"$/ do |property, value|
28
+ @current.update_attribute(property.to_sym, value)
29
+ end
30
+ When /^(?:|I )go to (.+)$/ do |page_name|
31
+ visit path_to(page_name)
32
+ end
33
+
34
+ When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector|
35
+ with_scope(selector) do
36
+ click_button(button)
37
+ end
38
+ end
39
+
40
+ When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector|
41
+ with_scope(selector) do
42
+ click_link(link)
43
+ end
44
+ end
45
+
46
+ When /^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/ do |field, value, selector|
47
+ with_scope(selector) do
48
+ fill_in(field, :with => value)
49
+ end
50
+ end
51
+
52
+ When /^(?:|I )fill in "([^"]*)" for "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector|
53
+ with_scope(selector) do
54
+ fill_in(field, :with => value)
55
+ end
56
+ end
57
+
58
+ # Use this to fill in an entire form with data from a table. Example:
59
+ #
60
+ # When I fill in the following:
61
+ # | Account Number | 5002 |
62
+ # | Expiry date | 2009-11-01 |
63
+ # | Note | Nice guy |
64
+ # | Wants Email? | |
65
+ #
66
+ # TODO: Add support for checkbox, select og option
67
+ # based on naming conventions.
68
+ #
69
+ When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields|
70
+ with_scope(selector) do
71
+ fields.rows_hash.each do |name, value|
72
+ When %{I fill in "#{name}" with "#{value}"}
73
+ end
74
+ end
75
+ end
76
+
77
+ When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector|
78
+ with_scope(selector) do
79
+ select(value, :from => field)
80
+ end
81
+ end
82
+
83
+ When /^(?:|I )check "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector|
84
+ with_scope(selector) do
85
+ check(field)
86
+ end
87
+ end
88
+
89
+ When /^(?:|I )uncheck "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector|
90
+ with_scope(selector) do
91
+ uncheck(field)
92
+ end
93
+ end
94
+
95
+ When /^(?:|I )choose "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector|
96
+ with_scope(selector) do
97
+ choose(field)
98
+ end
99
+ end
100
+
101
+ When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"(?: within "([^"]*)")?$/ do |path, field, selector|
102
+ with_scope(selector) do
103
+ attach_file(field, path)
104
+ end
105
+ end
106
+
107
+ Then /^(?:|I )should see JSON:$/ do |expected_json|
108
+ require 'json'
109
+ expected = JSON.pretty_generate(JSON.parse(expected_json))
110
+ actual = JSON.pretty_generate(JSON.parse(response.body))
111
+ expected.should == actual
112
+ end
113
+
114
+ Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
115
+ with_scope(selector) do
116
+ if page.respond_to? :should
117
+ page.should have_content(text)
118
+ else
119
+ assert page.has_content?(text)
120
+ end
121
+ end
122
+ end
123
+
124
+ Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
125
+ regexp = Regexp.new(regexp)
126
+ with_scope(selector) do
127
+ if page.respond_to? :should
128
+ page.should have_xpath('//*', :text => regexp)
129
+ else
130
+ assert page.has_xpath?('//*', :text => regexp)
131
+ end
132
+ end
133
+ end
134
+
135
+ Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
136
+ with_scope(selector) do
137
+ if page.respond_to? :should
138
+ page.should have_no_content(text)
139
+ else
140
+ assert page.has_no_content?(text)
141
+ end
142
+ end
143
+ end
144
+
145
+ Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
146
+ regexp = Regexp.new(regexp)
147
+ with_scope(selector) do
148
+ if page.respond_to? :should
149
+ page.should have_no_xpath('//*', :text => regexp)
150
+ else
151
+ assert page.has_no_xpath?('//*', :text => regexp)
152
+ end
153
+ end
154
+ end
155
+
156
+ Then /^the "([^"]*)" field(?: within "([^"]*)")? should contain "([^"]*)"$/ do |field, selector, value|
157
+ with_scope(selector) do
158
+ field = find_field(field)
159
+ field_value = (field.tag_name == 'textarea') ? field.text : field.value
160
+ if field_value.respond_to? :should
161
+ field_value.should =~ /#{value}/
162
+ else
163
+ assert_match(/#{value}/, field_value)
164
+ end
165
+ end
166
+ end
167
+
168
+ Then /^the "([^"]*)" field(?: within "([^"]*)")? should not contain "([^"]*)"$/ do |field, selector, value|
169
+ with_scope(selector) do
170
+ field = find_field(field)
171
+ field_value = (field.tag_name == 'textarea') ? field.text : field.value
172
+ if field_value.respond_to? :should_not
173
+ field_value.should_not =~ /#{value}/
174
+ else
175
+ assert_no_match(/#{value}/, field_value)
176
+ end
177
+ end
178
+ end
179
+
180
+ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector|
181
+ with_scope(selector) do
182
+ field_checked = find_field(label)['checked']
183
+ if field_checked.respond_to? :should
184
+ field_checked.should be_true
185
+ else
186
+ assert field_checked
187
+ end
188
+ end
189
+ end
190
+
191
+ Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector|
192
+ with_scope(selector) do
193
+ field_checked = find_field(label)['checked']
194
+ if field_checked.respond_to? :should
195
+ field_checked.should be_false
196
+ else
197
+ assert !field_checked
198
+ end
199
+ end
200
+ end
201
+
202
+ Then /^(?:|I )should be on (.+)$/ do |page_name|
203
+ current_path = URI.parse(current_url).path
204
+ if current_path.respond_to? :should
205
+ current_path.should == path_to(page_name)
206
+ else
207
+ assert_equal path_to(page_name), current_path
208
+ end
209
+ end
210
+
211
+ Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
212
+ query = URI.parse(current_url).query
213
+ actual_params = query ? CGI.parse(query) : {}
214
+ expected_params = {}
215
+ expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
216
+
217
+ if actual_params.respond_to? :should
218
+ actual_params.should == expected_params
219
+ else
220
+ assert_equal expected_params, actual_params
221
+ end
222
+ end
223
+
224
+ Then /^show me the page$/ do
225
+ save_and_open_page
226
+ end