admin_data 1.1.11 → 1.1.12

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 (42) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +5 -0
  3. data/Gemfile.lock +19 -0
  4. data/README.md +1 -1
  5. data/Rakefile +2 -50
  6. data/admin_data.gemspec +23 -0
  7. data/app/helpers/admin_data/application_helper.rb +7 -0
  8. data/app/views/admin_data/search/search/_listing.html.erb +1 -1
  9. data/config/routes.rb +24 -22
  10. data/lib/admin_data/version.rb +1 -1
  11. data/test/rails_root/Gemfile +23 -0
  12. data/test/rails_root/Gemfile.lock +157 -0
  13. data/test/rails_root/README.md +11 -0
  14. data/test/rails_root/Rakefile +7 -0
  15. data/test/rails_root/app/views/layouts/application.html.erb +14 -0
  16. data/test/rails_root/config/cucumber.yml +11 -0
  17. data/test/rails_root/config/database.yml +25 -0
  18. data/test/rails_root/config/locales/en.yml +5 -0
  19. data/test/rails_root/config.ru +4 -0
  20. data/test/rails_root/db/development.sqlite3 +0 -0
  21. data/test/rails_root/db/production.sqlite3 +1 -0
  22. data/test/rails_root/features/advance_search/boolean.feature +74 -0
  23. data/test/rails_root/features/advance_search/datetime.feature +101 -0
  24. data/test/rails_root/features/advance_search/delete_all.feature +20 -0
  25. data/test/rails_root/features/advance_search/destroy_all.feature +20 -0
  26. data/test/rails_root/features/advance_search/integer.feature +69 -0
  27. data/test/rails_root/features/advance_search/multiple_rows.feature +87 -0
  28. data/test/rails_root/features/advance_search/sort.feature +16 -0
  29. data/test/rails_root/features/advance_search/string.feature +130 -0
  30. data/test/rails_root/features/crud.feature +50 -0
  31. data/test/rails_root/features/crud_show.feature +56 -0
  32. data/test/rails_root/features/feed.feature +13 -0
  33. data/test/rails_root/features/home.feature +41 -0
  34. data/test/rails_root/features/migration.feature +7 -0
  35. data/test/rails_root/features/quick_search.feature +124 -0
  36. data/test/rails_root/features/table_structure.feature +18 -0
  37. data/test/rails_root/lib/tasks/.gitkeep +0 -0
  38. data/test/rails_root/lib/tasks/cucumber.rake +53 -0
  39. data/test/rails_root/public/.gitkeep +0 -0
  40. data/test/rails_root/script/cucumber +10 -0
  41. data/test/rails_root/script/rails +6 -0
  42. metadata +81 -77
@@ -0,0 +1,124 @@
1
+ Feature: quick search
2
+
3
+ Background:
4
+ When configured to display only 2 records per page
5
+ When configured to rename City columns:
6
+ | column | alias |
7
+ | :id | ID |
8
+ | :name | City Name |
9
+ | :data | City Info |
10
+
11
+ Scenario: quick search with no search term
12
+ Given the following user exists:
13
+ | first_name | last_name |
14
+ | Mary | Jane |
15
+ | John | Smith |
16
+ | Neil | Singh |
17
+ | Trisha | Singh |
18
+ Given I visit quick_search page
19
+ Then first id of table should be of "Trisha"
20
+ Then I should see "Next →"
21
+ Then I follow "Next →"
22
+ Then verify that user "first_name" is "John"
23
+ Then verify that user "last_name" is "Smith"
24
+
25
+ @javascript
26
+ Scenario: quick search with no search term for Newspaper which has paper_id as primary key
27
+ Given a newspaper exists
28
+ Given I visit admin_data page
29
+ When I select "newspaper" from "drop_down_klasses"
30
+ Then I should see "Listing Newspaper"
31
+
32
+ @javascript
33
+ Scenario: quick search with no search term for City which has to_model declared
34
+ Given a city exists
35
+ Given I visit admin_data page
36
+ When I select "city" from "drop_down_klasses"
37
+ Then I should see "Listing City"
38
+ When I follow "seattle"
39
+ Then I should see "seattle"
40
+ Then I should see population_5000
41
+
42
+ Scenario: sorting
43
+ Given the following user exists:
44
+ | first_name | last_name |
45
+ | Mary | Jane |
46
+ | John | Smith |
47
+ Given I visit quick_search page
48
+ When I select "id asc" from "sortby"
49
+ When I press "Search"
50
+ Then verify that user "first_name" is "Mary"
51
+ Then verify that user "last_name" is "Jane"
52
+
53
+ Scenario: quick search with search term
54
+ Given the following user exists:
55
+ | first_name | last_name |
56
+ | Mary | Jane |
57
+ | John | Smith |
58
+ Given I visit quick_search page
59
+ When I fill in "quick_search_input" with "John"
60
+ When I press "Search"
61
+ Then I should see "Search result: 1 record found"
62
+ Then verify that user "first_name" is "John"
63
+ Then verify that user "last_name" is "Smith"
64
+
65
+ Scenario: quick search with search term with association info
66
+ Given the following user exists:
67
+ | first name | last name |
68
+ | Mary | Jane |
69
+ Given the following phone number exists:
70
+ | number | user |
71
+ | 123-456-7890 | first name:Mary |
72
+ | 123-456-7777 | first name:Mary |
73
+ When I visit quick search page with association info page
74
+ Then I should see "has 2 phone_numbers"
75
+ Then I should see "2" rows in table "view_table"
76
+
77
+ Scenario: quick search with wrong klass name
78
+ When I visit quick search with wrong klass name page
79
+ Then I should see "wrong params[:klass] was supplied"
80
+
81
+ Scenario: quick search with wrong base klass name
82
+ Given the following user exists:
83
+ | first name | last name |
84
+ | Mary | Jane |
85
+ When I visit quick search with wrong base klass name page
86
+ Then I should see "user_wrong is an invalid value"
87
+
88
+ Scenario: quick search with wrong children klass name
89
+ Given the following user exists:
90
+ | first name | last name |
91
+ | Mary | Jane |
92
+ When I visit quick search with wrong children klass name page
93
+ Then I should see "phone_numbers_wrong is not a valid has_many association"
94
+
95
+ @javascript
96
+ Scenario: quick search for website with custom columns order
97
+ Given a website exists
98
+ Given I visit admin_data page
99
+ When I select "website" from "drop_down_klasses"
100
+ Then I should see tabular attributes for website with custom columns order
101
+
102
+ @javascript
103
+ Scenario: quick search for city with custom columns header
104
+ Given a city exists
105
+ Given I visit admin_data page
106
+ When I select "city" from "drop_down_klasses"
107
+ Then I should see tabular attributes for city with custom column headers
108
+
109
+ @javascript
110
+ Scenario: quick search for User with has_many info
111
+ Given the following user exists:
112
+ | first name | last name |
113
+ | Mary | Jane |
114
+ Given the following phone number exists:
115
+ | number | user |
116
+ | 123-456-7890 | first name:Mary |
117
+ | 123-456-7899 | first name:Mary |
118
+ Given user config has defined additional_column phone_numbers
119
+ Given I visit admin_data page
120
+ When I select "user" from "drop_down_klasses"
121
+ Then table should have additional column phone_numbers with valid data
122
+ Then reset columns_order and column_settings for User
123
+
124
+
@@ -0,0 +1,18 @@
1
+ Feature: table structure
2
+
3
+ Scenario: table structure
4
+ Given I visit quick_search page
5
+ When I follow "Table Structure"
6
+ Then I should see "Table name : users"
7
+ Then I should see following tabular attributes:
8
+ |Column Name | Type | Null | Default |
9
+ | id | integer | false | |
10
+ | first_name | string | true | |
11
+ | last_name | string | true | |
12
+ | age | integer | true | |
13
+ | data | text | true | |
14
+ | active | boolean | true | false |
15
+ | description | text | true | |
16
+ | born_at | datetime | true | |
17
+ | created_at | datetime | true | |
18
+ | updated_at | datetime | true | |
File without changes
@@ -0,0 +1,53 @@
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
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9
+
10
+ vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11
+ $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12
+
13
+ begin
14
+ require 'cucumber/rake/task'
15
+
16
+ namespace :cucumber do
17
+ Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
18
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19
+ t.fork = true # You may get faster startup if you set this to false
20
+ t.profile = 'default'
21
+ end
22
+
23
+ Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
24
+ t.binary = vendored_cucumber_bin
25
+ t.fork = true # You may get faster startup if you set this to false
26
+ t.profile = 'wip'
27
+ end
28
+
29
+ Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
30
+ t.binary = vendored_cucumber_bin
31
+ t.fork = true # You may get faster startup if you set this to false
32
+ t.profile = 'rerun'
33
+ end
34
+
35
+ desc 'Run all features'
36
+ task :all => [:ok, :wip]
37
+ end
38
+ desc 'Alias for cucumber:ok'
39
+ task :cucumber => 'cucumber:ok'
40
+
41
+ task :default => :cucumber
42
+
43
+ task :features => :cucumber do
44
+ STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
45
+ end
46
+ rescue LoadError
47
+ desc 'cucumber rake task not available (cucumber not installed)'
48
+ task :cucumber do
49
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
50
+ end
51
+ end
52
+
53
+ end
File without changes
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
4
+ if vendored_cucumber_bin
5
+ load File.expand_path(vendored_cucumber_bin)
6
+ else
7
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
8
+ require 'cucumber'
9
+ load Cucumber::BINARY
10
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
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'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admin_data
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 11
10
- version: 1.1.11
9
+ - 12
10
+ version: 1.1.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Neeraj Singh
@@ -15,16 +15,14 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-16 00:00:00 -04:00
18
+ date: 2011-06-21 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: will_paginate
23
- prerelease: false
24
22
  requirement: &id001 !ruby/object:Gem::Requirement
25
23
  none: false
26
24
  requirements:
27
- - - ">="
25
+ - - "="
28
26
  - !ruby/object:Gem::Version
29
27
  hash: -1876988247
30
28
  segments:
@@ -32,83 +30,27 @@ dependencies:
32
30
  - 0
33
31
  - pre2
34
32
  version: 3.0.pre2
33
+ name: will_paginate
34
+ prerelease: false
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: flexmock
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 49
46
- segments:
47
- - 0
48
- - 8
49
- - 7
50
- version: 0.8.7
51
- type: :development
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: shoulda
55
- prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 37
62
- segments:
63
- - 2
64
- - 11
65
- - 3
66
- version: 2.11.3
67
- type: :development
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: factory_girl_rails
71
- prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
- version: "0"
81
- type: :development
82
- version_requirements: *id004
83
- - !ruby/object:Gem::Dependency
84
- name: nokogiri
85
- prerelease: false
86
- requirement: &id005 !ruby/object:Gem::Requirement
87
- none: false
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- hash: 113
92
- segments:
93
- - 1
94
- - 4
95
- - 3
96
- - 1
97
- version: 1.4.3.1
98
- type: :development
99
- version_requirements: *id005
100
- description: Manage database using browser
101
- email: neerajdotname@gmail.com
37
+ description: Manage data as if you own it
38
+ email:
39
+ - neeraj@BigBinary.com
102
40
  executables: []
103
41
 
104
42
  extensions: []
105
43
 
106
- extra_rdoc_files:
107
- - README.md
44
+ extra_rdoc_files: []
45
+
108
46
  files:
47
+ - .gitignore
48
+ - Gemfile
49
+ - Gemfile.lock
109
50
  - History.txt
110
51
  - README.md
111
52
  - Rakefile
53
+ - admin_data.gemspec
112
54
  - app/controllers/admin_data/application_controller.rb
113
55
  - app/controllers/admin_data/crud_controller.rb
114
56
  - app/controllers/admin_data/feed_controller.rb
@@ -191,6 +133,10 @@ files:
191
133
  - lib/public/javascripts/vendor/rails.js
192
134
  - lib/public/stylesheets/base.css
193
135
  - lib/public/stylesheets/vendor/jquery-ui-1.7.2.custom.css
136
+ - test/rails_root/Gemfile
137
+ - test/rails_root/Gemfile.lock
138
+ - test/rails_root/README.md
139
+ - test/rails_root/Rakefile
194
140
  - test/rails_root/app/controllers/application_controller.rb
195
141
  - test/rails_root/app/helpers/application_helper.rb
196
142
  - test/rails_root/app/models/city.rb
@@ -199,8 +145,12 @@ files:
199
145
  - test/rails_root/app/models/phone_number.rb
200
146
  - test/rails_root/app/models/user.rb
201
147
  - test/rails_root/app/models/website.rb
148
+ - test/rails_root/app/views/layouts/application.html.erb
149
+ - test/rails_root/config.ru
202
150
  - test/rails_root/config/application.rb
203
151
  - test/rails_root/config/boot.rb
152
+ - test/rails_root/config/cucumber.yml
153
+ - test/rails_root/config/database.yml
204
154
  - test/rails_root/config/environment.rb
205
155
  - test/rails_root/config/environments/development.rb
206
156
  - test/rails_root/config/environments/production.rb
@@ -212,10 +162,27 @@ files:
212
162
  - test/rails_root/config/initializers/mime_types.rb
213
163
  - test/rails_root/config/initializers/secret_token.rb
214
164
  - test/rails_root/config/initializers/session_store.rb
165
+ - test/rails_root/config/locales/en.yml
215
166
  - test/rails_root/config/routes.rb
167
+ - test/rails_root/db/development.sqlite3
216
168
  - test/rails_root/db/migrate/20091030202259_create_users.rb
169
+ - test/rails_root/db/production.sqlite3
217
170
  - test/rails_root/db/schema.rb
218
171
  - test/rails_root/db/seeds.rb
172
+ - test/rails_root/features/advance_search/boolean.feature
173
+ - test/rails_root/features/advance_search/datetime.feature
174
+ - test/rails_root/features/advance_search/delete_all.feature
175
+ - test/rails_root/features/advance_search/destroy_all.feature
176
+ - test/rails_root/features/advance_search/integer.feature
177
+ - test/rails_root/features/advance_search/multiple_rows.feature
178
+ - test/rails_root/features/advance_search/sort.feature
179
+ - test/rails_root/features/advance_search/string.feature
180
+ - test/rails_root/features/crud.feature
181
+ - test/rails_root/features/crud_show.feature
182
+ - test/rails_root/features/feed.feature
183
+ - test/rails_root/features/home.feature
184
+ - test/rails_root/features/migration.feature
185
+ - test/rails_root/features/quick_search.feature
219
186
  - test/rails_root/features/step_definitions/advance_search_steps.rb
220
187
  - test/rails_root/features/step_definitions/app_steps.rb
221
188
  - test/rails_root/features/step_definitions/async.rb
@@ -228,11 +195,17 @@ files:
228
195
  - test/rails_root/features/support/env.rb
229
196
  - test/rails_root/features/support/hooks.rb
230
197
  - test/rails_root/features/support/paths.rb
198
+ - test/rails_root/features/table_structure.feature
199
+ - test/rails_root/lib/tasks/.gitkeep
200
+ - test/rails_root/lib/tasks/cucumber.rake
201
+ - test/rails_root/public/.gitkeep
202
+ - test/rails_root/script/cucumber
203
+ - test/rails_root/script/rails
231
204
  - test/rails_root/test/factories.rb
232
205
  - test/rails_root/test/performance/browsing_test.rb
233
206
  - test/rails_root/test/test_helper.rb
234
207
  has_rdoc: true
235
- homepage: http://github.com/neerajdotname/admin_data
208
+ homepage: ""
236
209
  licenses: []
237
210
 
238
211
  post_install_message:
@@ -260,12 +233,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
233
  version: "0"
261
234
  requirements: []
262
235
 
263
- rubyforge_project:
236
+ rubyforge_project: admin_data
264
237
  rubygems_version: 1.3.7
265
238
  signing_key:
266
239
  specification_version: 3
267
- summary: Manage database using browser
240
+ summary: Manage data as if you own it
268
241
  test_files:
242
+ - test/rails_root/Gemfile
243
+ - test/rails_root/Gemfile.lock
244
+ - test/rails_root/README.md
245
+ - test/rails_root/Rakefile
269
246
  - test/rails_root/app/controllers/application_controller.rb
270
247
  - test/rails_root/app/helpers/application_helper.rb
271
248
  - test/rails_root/app/models/city.rb
@@ -274,8 +251,12 @@ test_files:
274
251
  - test/rails_root/app/models/phone_number.rb
275
252
  - test/rails_root/app/models/user.rb
276
253
  - test/rails_root/app/models/website.rb
254
+ - test/rails_root/app/views/layouts/application.html.erb
255
+ - test/rails_root/config.ru
277
256
  - test/rails_root/config/application.rb
278
257
  - test/rails_root/config/boot.rb
258
+ - test/rails_root/config/cucumber.yml
259
+ - test/rails_root/config/database.yml
279
260
  - test/rails_root/config/environment.rb
280
261
  - test/rails_root/config/environments/development.rb
281
262
  - test/rails_root/config/environments/production.rb
@@ -287,10 +268,27 @@ test_files:
287
268
  - test/rails_root/config/initializers/mime_types.rb
288
269
  - test/rails_root/config/initializers/secret_token.rb
289
270
  - test/rails_root/config/initializers/session_store.rb
271
+ - test/rails_root/config/locales/en.yml
290
272
  - test/rails_root/config/routes.rb
273
+ - test/rails_root/db/development.sqlite3
291
274
  - test/rails_root/db/migrate/20091030202259_create_users.rb
275
+ - test/rails_root/db/production.sqlite3
292
276
  - test/rails_root/db/schema.rb
293
277
  - test/rails_root/db/seeds.rb
278
+ - test/rails_root/features/advance_search/boolean.feature
279
+ - test/rails_root/features/advance_search/datetime.feature
280
+ - test/rails_root/features/advance_search/delete_all.feature
281
+ - test/rails_root/features/advance_search/destroy_all.feature
282
+ - test/rails_root/features/advance_search/integer.feature
283
+ - test/rails_root/features/advance_search/multiple_rows.feature
284
+ - test/rails_root/features/advance_search/sort.feature
285
+ - test/rails_root/features/advance_search/string.feature
286
+ - test/rails_root/features/crud.feature
287
+ - test/rails_root/features/crud_show.feature
288
+ - test/rails_root/features/feed.feature
289
+ - test/rails_root/features/home.feature
290
+ - test/rails_root/features/migration.feature
291
+ - test/rails_root/features/quick_search.feature
294
292
  - test/rails_root/features/step_definitions/advance_search_steps.rb
295
293
  - test/rails_root/features/step_definitions/app_steps.rb
296
294
  - test/rails_root/features/step_definitions/async.rb
@@ -303,6 +301,12 @@ test_files:
303
301
  - test/rails_root/features/support/env.rb
304
302
  - test/rails_root/features/support/hooks.rb
305
303
  - test/rails_root/features/support/paths.rb
304
+ - test/rails_root/features/table_structure.feature
305
+ - test/rails_root/lib/tasks/.gitkeep
306
+ - test/rails_root/lib/tasks/cucumber.rake
307
+ - test/rails_root/public/.gitkeep
308
+ - test/rails_root/script/cucumber
309
+ - test/rails_root/script/rails
306
310
  - test/rails_root/test/factories.rb
307
311
  - test/rails_root/test/performance/browsing_test.rb
308
312
  - test/rails_root/test/test_helper.rb