the_jobbook_admin_data 1.3.0a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (174) hide show
  1. data/.gitignore +19 -0
  2. data/CHANGELOG.rdoc +284 -0
  3. data/Gemfile +22 -0
  4. data/Gemfile.lock +121 -0
  5. data/Guardfile +14 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.md +37 -0
  8. data/README.rdoc +3 -0
  9. data/Rakefile +40 -0
  10. data/admin_data.gemspec +23 -0
  11. data/app/assets/images/add.png +0 -0
  12. data/app/assets/images/admin_data/.gitkeep +0 -0
  13. data/app/assets/images/no.png +0 -0
  14. data/app/assets/images/site.png +0 -0
  15. data/app/assets/images/sort_by_asc.jpg +0 -0
  16. data/app/assets/images/sort_by_desc.jpg +0 -0
  17. data/app/assets/images/sort_by_nothing.jpg +0 -0
  18. data/app/assets/javascripts/admin_data.js +18 -0
  19. data/app/assets/javascripts/admin_data/application.js +15 -0
  20. data/app/assets/javascripts/advance_search/act_on_result.js +45 -0
  21. data/app/assets/javascripts/advance_search/advance_search.js +83 -0
  22. data/app/assets/javascripts/advance_search/advance_search_structure.js +79 -0
  23. data/app/assets/javascripts/advance_search/ajaxify_advance_search.js +28 -0
  24. data/app/assets/javascripts/advance_search/build_first_row.js +8 -0
  25. data/app/assets/javascripts/advance_search/event_bindings.js +76 -0
  26. data/app/assets/javascripts/advance_search/global_ajax_setting.js +10 -0
  27. data/app/assets/javascripts/advance_search/sortby.js +14 -0
  28. data/app/assets/javascripts/advance_search/trigger_submit_on_domready.js +6 -0
  29. data/app/assets/javascripts/analytics/report.js +7 -0
  30. data/app/assets/javascripts/misc/drop_down_change.js +8 -0
  31. data/app/assets/javascripts/misc/js_util.js +58 -0
  32. data/app/assets/javascripts/misc/quick_search_input_focus.js +6 -0
  33. data/app/assets/javascripts/vendor/jquery-1.4.2.js +6240 -0
  34. data/app/assets/javascripts/vendor/jquery-ui-1.7.2.custom.min.js +298 -0
  35. data/app/assets/javascripts/vendor/jquery.ba-isjquery.js +21 -0
  36. data/app/assets/javascripts/vendor/jquery_form.js +814 -0
  37. data/app/assets/javascripts/vendor/log.js +9 -0
  38. data/app/assets/javascripts/vendor/rails.js +132 -0
  39. data/app/assets/stylesheets/admin_data.css +1141 -0
  40. data/app/assets/stylesheets/admin_data/application.css +13 -0
  41. data/app/assets/stylesheets/vendor/jquery-ui-1.7.2.custom.css +406 -0
  42. data/app/controllers/admin_data/application_controller.rb +107 -0
  43. data/app/controllers/admin_data/crud_controller.rb +100 -0
  44. data/app/controllers/admin_data/feed_controller.rb +48 -0
  45. data/app/controllers/admin_data/home_controller.rb +8 -0
  46. data/app/controllers/admin_data/migration_controller.rb +18 -0
  47. data/app/controllers/admin_data/public_controller.rb +28 -0
  48. data/app/controllers/admin_data/search_controller.rb +143 -0
  49. data/app/controllers/admin_data/table_structure_controller.rb +25 -0
  50. data/app/helpers/admin_data/application_helper.rb +320 -0
  51. data/app/views/admin_data/crud/association/_association_info.html.erb +11 -0
  52. data/app/views/admin_data/crud/association/_belongs_to_info.html.erb +7 -0
  53. data/app/views/admin_data/crud/association/_habtm_info.html.erb +7 -0
  54. data/app/views/admin_data/crud/association/_has_many_info.html.erb +7 -0
  55. data/app/views/admin_data/crud/association/_has_one_info.html.erb +6 -0
  56. data/app/views/admin_data/crud/edit.html.erb +36 -0
  57. data/app/views/admin_data/crud/misc/_form.html.erb +38 -0
  58. data/app/views/admin_data/crud/misc/_modify_record.html.erb +18 -0
  59. data/app/views/admin_data/crud/new.html.erb +25 -0
  60. data/app/views/admin_data/crud/show.html.erb +42 -0
  61. data/app/views/admin_data/feed/index.rss.builder +25 -0
  62. data/app/views/admin_data/home/index.html.erb +21 -0
  63. data/app/views/admin_data/migration/index.html.erb +18 -0
  64. data/app/views/admin_data/migration/jstest.html.erb +51 -0
  65. data/app/views/admin_data/search/advance_search.html.erb +1 -0
  66. data/app/views/admin_data/search/quick_search.html.erb +1 -0
  67. data/app/views/admin_data/search/search/_advance_search_form.html.erb +52 -0
  68. data/app/views/admin_data/search/search/_errors.html.erb +5 -0
  69. data/app/views/admin_data/search/search/_listing.html.erb +43 -0
  70. data/app/views/admin_data/search/search/_search_form.html.erb +27 -0
  71. data/app/views/admin_data/search/search/_title.html.erb +34 -0
  72. data/app/views/admin_data/shared/_breadcrum.html.erb +16 -0
  73. data/app/views/admin_data/shared/_drop_down_klasses.html.erb +4 -0
  74. data/app/views/admin_data/shared/_flash_message.html.erb +13 -0
  75. data/app/views/admin_data/shared/_header.html.erb +20 -0
  76. data/app/views/admin_data/shared/_powered_by.html.erb +6 -0
  77. data/app/views/admin_data/shared/_secondary_navigation.html.erb +26 -0
  78. data/app/views/admin_data/table_structure/index.html.erb +54 -0
  79. data/app/views/layouts/admin_data.html.erb +34 -0
  80. data/app/views/layouts/admin_data/application.html.erb +14 -0
  81. data/app/views/layouts/search.html.erb +71 -0
  82. data/config/routes.rb +32 -0
  83. data/lib/admin_data.rb +27 -0
  84. data/lib/admin_data/active_record_util.rb +102 -0
  85. data/lib/admin_data/analytics.rb +176 -0
  86. data/lib/admin_data/authenticator.rb +15 -0
  87. data/lib/admin_data/config.rb +38 -0
  88. data/lib/admin_data/configuration.rb +127 -0
  89. data/lib/admin_data/date_util.rb +58 -0
  90. data/lib/admin_data/engine.rb +17 -0
  91. data/lib/admin_data/model_finder.rb +15 -0
  92. data/lib/admin_data/rails_version_check.rb +8 -0
  93. data/lib/admin_data/search.rb +188 -0
  94. data/lib/admin_data/setup_config.rb +24 -0
  95. data/lib/admin_data/util.rb +102 -0
  96. data/lib/admin_data/version.rb +3 -0
  97. data/lib/tasks/admin_data_tasks.rake +4 -0
  98. data/script/rails +8 -0
  99. data/test/admin_data_test.rb +7 -0
  100. data/test/dummy/README.md +19 -0
  101. data/test/dummy/Rakefile +7 -0
  102. data/test/dummy/app/controllers/application_controller.rb +3 -0
  103. data/test/dummy/app/helpers/application_helper.rb +5 -0
  104. data/test/dummy/app/models/user.rb +3 -0
  105. data/test/dummy/app/models/user/student.rb +2 -0
  106. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  107. data/test/dummy/config.ru +4 -0
  108. data/test/dummy/config/application.rb +15 -0
  109. data/test/dummy/config/boot.rb +13 -0
  110. data/test/dummy/config/cucumber.yml +9 -0
  111. data/test/dummy/config/database.yml +25 -0
  112. data/test/dummy/config/database.yml.mysql +22 -0
  113. data/test/dummy/config/database.yml.pg +15 -0
  114. data/test/dummy/config/database.yml.sqlite3 +25 -0
  115. data/test/dummy/config/environment.rb +5 -0
  116. data/test/dummy/config/environments/development.rb +22 -0
  117. data/test/dummy/config/environments/production.rb +49 -0
  118. data/test/dummy/config/environments/test.rb +35 -0
  119. data/test/dummy/config/initializers/admin_data.rb +15 -0
  120. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  121. data/test/dummy/config/initializers/empty_spaces_to_nil.rb +10 -0
  122. data/test/dummy/config/initializers/inflections.rb +10 -0
  123. data/test/dummy/config/initializers/mime_types.rb +5 -0
  124. data/test/dummy/config/initializers/secret_token.rb +7 -0
  125. data/test/dummy/config/initializers/session_store.rb +8 -0
  126. data/test/dummy/config/locales/en.yml +5 -0
  127. data/test/dummy/config/routes.rb +9 -0
  128. data/test/dummy/db/development.sqlite3 +0 -0
  129. data/test/dummy/db/migrate/20091030202259_create_tables.rb +72 -0
  130. data/test/dummy/db/production.sqlite3 +1 -0
  131. data/test/dummy/db/schema.rb +23 -0
  132. data/test/dummy/db/seeds.rb +40 -0
  133. data/test/dummy/db/test.sqlite3 +0 -0
  134. data/test/dummy/features/advance_search/boolean.feature +74 -0
  135. data/test/dummy/features/advance_search/datetime.feature +101 -0
  136. data/test/dummy/features/advance_search/delete_all.feature +20 -0
  137. data/test/dummy/features/advance_search/destroy_all.feature +20 -0
  138. data/test/dummy/features/advance_search/integer.feature +69 -0
  139. data/test/dummy/features/advance_search/multiple_rows.feature +87 -0
  140. data/test/dummy/features/advance_search/string.feature +130 -0
  141. data/test/dummy/features/crud.feature +50 -0
  142. data/test/dummy/features/crud_show.feature +56 -0
  143. data/test/dummy/features/feed.feature +13 -0
  144. data/test/dummy/features/home.feature +42 -0
  145. data/test/dummy/features/migration.feature +7 -0
  146. data/test/dummy/features/quick_search.feature +113 -0
  147. data/test/dummy/features/step_definitions/advance_search_steps.rb +13 -0
  148. data/test/dummy/features/step_definitions/app_steps.rb +36 -0
  149. data/test/dummy/features/step_definitions/async.rb +18 -0
  150. data/test/dummy/features/step_definitions/configuration_steps.rb +61 -0
  151. data/test/dummy/features/step_definitions/crud_show_steps.rb +37 -0
  152. data/test/dummy/features/step_definitions/feed_steps.rb +24 -0
  153. data/test/dummy/features/step_definitions/quick_search_steps.rb +68 -0
  154. data/test/dummy/features/step_definitions/util.rb +90 -0
  155. data/test/dummy/features/step_definitions/web_steps.rb +219 -0
  156. data/test/dummy/features/support/env.rb +66 -0
  157. data/test/dummy/features/support/hooks.rb +9 -0
  158. data/test/dummy/features/support/paths.rb +33 -0
  159. data/test/dummy/features/table_structure.feature +18 -0
  160. data/test/dummy/lib/tasks/.gitkeep +0 -0
  161. data/test/dummy/lib/tasks/cucumber.rake +53 -0
  162. data/test/dummy/lib/tasks/dbs.rake +30 -0
  163. data/test/dummy/lib/tasks/sample_cars.rake +18 -0
  164. data/test/dummy/public/.gitkeep +0 -0
  165. data/test/dummy/script/cucumber +10 -0
  166. data/test/dummy/script/rails +6 -0
  167. data/test/dummy/test/factories.rb +30 -0
  168. data/test/dummy/test/test_helper.rb +7 -0
  169. data/test/integration/navigation_test.rb +10 -0
  170. data/test/test_helper.rb +15 -0
  171. data/test/unit/admin_data/model_finder_test.rb +16 -0
  172. data/test/unit/car_test.rb +96 -0
  173. data/test/unit/user_phone_test.rb +19 -0
  174. metadata +253 -0
Binary file
@@ -0,0 +1,74 @@
1
+ Feature: Advance Search for boolean
2
+
3
+ @javascript
4
+ Scenario: Advance Search for a boolean
5
+ Given a user exists
6
+ Given I visit advance_search page
7
+ When I select "active" from "adv_search[1_row][col1]"
8
+ Then page should have css "#advance_search_table tr td select.col2"
9
+ When I select "is null" from "adv_search[1_row][col2]"
10
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
11
+ When I select "is not null" from "adv_search[1_row][col2]"
12
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
13
+ When I select "is true" from "adv_search[1_row][col2]"
14
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
15
+ When I select "is false" from "adv_search[1_row][col2]"
16
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
17
+
18
+ @javascript
19
+ Scenario: option "is false"
20
+ Given the following user exists:
21
+ | first name | last name | active |
22
+ | John | Smith | false |
23
+ | Mary | Jane | true |
24
+ Given I visit advance_search page
25
+ When I select "active" from "adv_search[1_row][col1]"
26
+ When I select "is false" from "adv_search[1_row][col2]"
27
+ When I press "Search"
28
+ Then I should see "Search result: 1 record found"
29
+ Then async verify that user "first_name" is "John"
30
+ Then async verify that user "last_name" is "Smith"
31
+
32
+ @javascript
33
+ Scenario: option "is true"
34
+ Given the following user exists:
35
+ | first name | last name | active |
36
+ | Mary | Jane | true |
37
+ | John | Smith | false |
38
+ Given I visit advance_search page
39
+ When I select "active" from "adv_search[1_row][col1]"
40
+ When I select "is true" from "adv_search[1_row][col2]"
41
+ When I press "Search"
42
+ Then I should see "Search result: 1 record found"
43
+ Then async verify that user "first_name" is "Mary"
44
+ Then async verify that user "last_name" is "Jane"
45
+
46
+ @javascript
47
+ Scenario: option "is null"
48
+ Given the following user exists:
49
+ | first name | last name | active |
50
+ | John | Smith | false |
51
+ | Mary | Jane | true |
52
+ Given first user's value for active is nil
53
+ Given I visit advance_search page
54
+ When I select "active" from "adv_search[1_row][col1]"
55
+ When I select "is null" from "adv_search[1_row][col2]"
56
+ When I press "Search"
57
+ Then I should see "Search result: 1 record found"
58
+ Then async verify that user "first_name" is "John"
59
+ Then async verify that user "last_name" is "Smith"
60
+
61
+ @javascript
62
+ Scenario: option "is not null"
63
+ Given the following user exists:
64
+ | first name | last name | active |
65
+ | Mary | Jane | true |
66
+ | John | Smith | false |
67
+ Given last user's value for active is nil
68
+ Given I visit advance_search page
69
+ When I select "active" from "adv_search[1_row][col1]"
70
+ When I select "is not null" from "adv_search[1_row][col2]"
71
+ When I press "Search"
72
+ Then I should see "Search result: 1 record found"
73
+ Then async verify that user "first_name" is "Mary"
74
+ Then async verify that user "last_name" is "Jane"
@@ -0,0 +1,101 @@
1
+ Feature: Advance Search datetime
2
+
3
+ @javascript
4
+ Scenario: test dropdown for datetime
5
+ Given a user exists
6
+ Given I visit advance_search page
7
+ When I select "created_at" from "adv_search[1_row][col1]"
8
+ Then page should have css "#advance_search_table tr td select.col2"
9
+ When I select "is null" from "adv_search[1_row][col2]"
10
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
11
+ When I select "is not null" from "adv_search[1_row][col2]"
12
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
13
+ When I select "on" from "adv_search[1_row][col2]"
14
+ Then async page should have text as current date for "#advance_search_table tr td input.col3"
15
+ When I select "on or before" from "adv_search[1_row][col2]"
16
+ Then async page should have text as current date for "#advance_search_table tr td input.col3"
17
+ When I select "on or after" from "adv_search[1_row][col2]"
18
+ Then async page should have text as current date for "#advance_search_table tr td input.col3"
19
+
20
+ @javascript
21
+ Scenario: option "is null"
22
+ Given the following user exists:
23
+ | first name | last name | born_at |
24
+ | John | Smith | |
25
+ | Mary | Jane | 03-November-2010 |
26
+ Given I visit advance_search page
27
+ When I select "born_at" from "adv_search[1_row][col1]"
28
+ When I select "is null" from "adv_search[1_row][col2]"
29
+ When I press "Search"
30
+ Then I should see "Search result: 1 record found"
31
+ Then async verify that user "first_name" is "John"
32
+ Then async verify that user "last_name" is "Smith"
33
+
34
+ @javascript
35
+ Scenario: option "is not null"
36
+ Given the following user exists:
37
+ | first name | last name | born_at |
38
+ | Mary | Jane | 03-November-2010 |
39
+ | John | Smith | |
40
+ Given I visit advance_search page
41
+ When I select "born_at" from "adv_search[1_row][col1]"
42
+ When I select "is not null" from "adv_search[1_row][col2]"
43
+ When I press "Search"
44
+ Then I should see "Search result: 1 record found"
45
+ Then async verify that user "first_name" is "Mary"
46
+ Then async verify that user "last_name" is "Jane"
47
+
48
+ @javascript
49
+ Scenario: option "on"
50
+ Given the following user exists:
51
+ | first name | last name | born_at |
52
+ | Mary | Jane | 03-November-2010 |
53
+ | John | Smith | 14-November-2010 |
54
+ Given I visit advance_search page
55
+ When I select "born_at" from "adv_search[1_row][col1]"
56
+ When I select "on" from "adv_search[1_row][col2]"
57
+ When I fill in "adv_search[1_row][col3]" with "03-November-2010"
58
+ When I press "Search"
59
+ Then I should see "Search result: 1 record found"
60
+ Then async verify that user "first_name" is "Mary"
61
+ Then async verify that user "last_name" is "Jane"
62
+
63
+ @javascript
64
+ Scenario: option "on or after"
65
+ Given the following user exists:
66
+ | first name | last name | born_at |
67
+ | John | Smith | 14-November-2010 |
68
+ | Mary | Jane | 03-November-2010 |
69
+ Given I visit advance_search page
70
+ When I select "born_at" from "adv_search[1_row][col1]"
71
+ When I select "on or after" from "adv_search[1_row][col2]"
72
+ When I fill in "adv_search[1_row][col3]" with "05-November-2010"
73
+ When I press "Search"
74
+ Then I should see "Search result: 1 record found"
75
+ Then async verify that user "first_name" is "John"
76
+ Then async verify that user "last_name" is "Smith"
77
+
78
+ @javascript
79
+ Scenario: option "on or before"
80
+ Given the following user exists:
81
+ | first name | last name | born_at |
82
+ | Mary | Jane | 03-November-2010 |
83
+ | John | Smith | 14-November-2010 |
84
+ Given I visit advance_search page
85
+ When I select "born_at" from "adv_search[1_row][col1]"
86
+ When I select "on or before" from "adv_search[1_row][col2]"
87
+ When I fill in "adv_search[1_row][col3]" with "05-November-2010"
88
+ When I press "Search"
89
+ Then I should see "Search result: 1 record found"
90
+ Then async verify that user "first_name" is "Mary"
91
+ Then async verify that user "last_name" is "Jane"
92
+
93
+ @javascript
94
+ Scenario: invalid integer value
95
+ Given I visit advance_search page
96
+ When I select "born_at" from "adv_search[1_row][col1]"
97
+ When I select "on" from "adv_search[1_row][col2]"
98
+ When I fill in "adv_search[1_row][col3]" with "xyz"
99
+ When I press "Search"
100
+ Then async I should see "xyz is not a valid date"
101
+
@@ -0,0 +1,20 @@
1
+ Feature: Advance search delete all
2
+
3
+ @javascript
4
+ Scenario: delete all
5
+ Given the following user exists:
6
+ | first name | last name |
7
+ | John | Smith |
8
+ | Mary | Jane |
9
+ | Jennifer | Jane |
10
+ Given I visit advance_search page
11
+ When I select "first_name" from "adv_search[1_row][col1]"
12
+ When I select "is exactly" from "adv_search[1_row][col2]"
13
+ When I fill in "adv_search[1_row][col3]" with "John"
14
+ When I press "Search"
15
+ Then I should see "Search result: 1 record found"
16
+ Then async verify that user "first_name" is "John"
17
+ Then async verify that user "last_name" is "Smith"
18
+ When async click "Delete All"
19
+ Then async verify that number of "User" records is "2"
20
+ Then asyc I should see "1 record deleted"
@@ -0,0 +1,20 @@
1
+ Feature: Advance search destroy all
2
+
3
+ @javascript
4
+ Scenario: destroy all
5
+ Given the following user exists:
6
+ | first name | last name |
7
+ | John | Smith |
8
+ | Mary | Jane |
9
+ | Jennifer | Jane |
10
+ Given I visit advance_search page
11
+ When I select "first_name" from "adv_search[1_row][col1]"
12
+ When I select "is exactly" from "adv_search[1_row][col2]"
13
+ When I fill in "adv_search[1_row][col3]" with "John"
14
+ When I press "Search"
15
+ Then I should see "Search result: 1 record found"
16
+ Then async verify that user "first_name" is "John"
17
+ Then async verify that user "last_name" is "Smith"
18
+ When async click "Destroy All"
19
+ Then async verify that number of "User" records is "2"
20
+ Then async I should see "1 record destroyed"
@@ -0,0 +1,69 @@
1
+ Feature: Advance Search for integer
2
+
3
+ @javascript
4
+ Scenario: Advance Search for an integer
5
+ Given a user exists
6
+ Given I visit advance_search page
7
+ When I select "age" from "adv_search[1_row][col1]"
8
+ Then page should have css "#advance_search_table tr td select.col2"
9
+ When I select "is equal to" from "adv_search[1_row][col2]"
10
+ Then page should have css "#advance_search_table tr td input.col3"
11
+ When I select "is less than" from "adv_search[1_row][col2]"
12
+ Then page should have css "#advance_search_table tr td input.col3"
13
+ When I select "is greater than" from "adv_search[1_row][col2]"
14
+ Then page should have css "#advance_search_table tr td input.col3"
15
+
16
+ @javascript
17
+ Scenario: option "is equal to"
18
+ Given the following user exists:
19
+ | first name | last name | age |
20
+ | John | Smith | 40 |
21
+ | Mary | Jane | 30 |
22
+ Given I visit advance_search page
23
+ When I select "age" from "adv_search[1_row][col1]"
24
+ When I select "is equal to" from "adv_search[1_row][col2]"
25
+ When I fill in "adv_search[1_row][col3]" with "40"
26
+ When I press "Search"
27
+ Then I should see "Search result: 1 record found"
28
+ Then async verify that user "first_name" is "John"
29
+ Then async verify that user "last_name" is "Smith"
30
+
31
+ @javascript
32
+ Scenario: option "is less than"
33
+ Given the following user exists:
34
+ | first name | last name | age |
35
+ | Mary | Jane | 30 |
36
+ | John | Smith | 40 |
37
+ Given I visit advance_search page
38
+ When I select "age" from "adv_search[1_row][col1]"
39
+ When I select "is less than" from "adv_search[1_row][col2]"
40
+ When I fill in "adv_search[1_row][col3]" with "35"
41
+ When I press "Search"
42
+ Then I should see "Search result: 1 record found"
43
+ Then async verify that user "first_name" is "Mary"
44
+ Then async verify that user "last_name" is "Jane"
45
+
46
+ @javascript
47
+ Scenario: option "is greater than"
48
+ Given the following user exists:
49
+ | first name | last name | age |
50
+ | John | Smith | 40 |
51
+ | Mary | Jane | 30 |
52
+ Given I visit advance_search page
53
+ When I select "age" from "adv_search[1_row][col1]"
54
+ When I select "is greater than" from "adv_search[1_row][col2]"
55
+ When I fill in "adv_search[1_row][col3]" with "35"
56
+ When I press "Search"
57
+ Then I should see "Search result: 1 record found"
58
+ Then async verify that user "first_name" is "John"
59
+ Then async verify that user "last_name" is "Smith"
60
+
61
+ @javascript
62
+ Scenario: invalid integer value
63
+ Given I visit advance_search page
64
+ When I select "age" from "adv_search[1_row][col1]"
65
+ When I select "is greater than" from "adv_search[1_row][col2]"
66
+ When I fill in "adv_search[1_row][col3]" with "xyz"
67
+ When I press "Search"
68
+ Then async I should see "xyz is not a valid integer"
69
+
@@ -0,0 +1,87 @@
1
+ Feature: Advance search multiple rows
2
+
3
+ @javascript
4
+ Scenario: two rows
5
+ Given the following user exists:
6
+ | first name | last name | age |
7
+ | Mary | Jane | 30 |
8
+ | Jennifer | Jane | 30 |
9
+ | John | Smith | 40 |
10
+ | John | Vander | 30 |
11
+ Given I visit advance_search page
12
+ When I select "first_name" from "adv_search[1_row][col1]"
13
+ When I select "is exactly" from "adv_search[1_row][col2]"
14
+ When I fill in "adv_search[1_row][col3]" with "John"
15
+
16
+ When I follow "add_row_link_1"
17
+
18
+ When I select "last_name" from "adv_search[2_row][col1]"
19
+ When I select "is exactly" from "adv_search[2_row][col2]"
20
+ When I fill in "adv_search[2_row][col3]" with "Smith"
21
+
22
+ When I press "Search"
23
+ Then I should see "Search result: 1 record found"
24
+ Then async verify that user "first_name" is "John"
25
+ Then async verify that user "last_name" is "Smith"
26
+
27
+
28
+ @javascript
29
+ Scenario: three rows
30
+ Given the following user exists:
31
+ | first name | last name | age |
32
+ | John | Smith | 40 |
33
+ | John | Smith | 30 |
34
+ | Mary | Jane | 30 |
35
+ | Mary | Jane | 40 |
36
+ | Jennifer | Jane | 30 |
37
+ Given I visit advance_search page
38
+ When I select "first_name" from "adv_search[1_row][col1]"
39
+ When I select "is exactly" from "adv_search[1_row][col2]"
40
+ When I fill in "adv_search[1_row][col3]" with "John"
41
+
42
+ When I follow "add_row_link_1"
43
+ When I select "last_name" from "adv_search[2_row][col1]"
44
+ When I select "is exactly" from "adv_search[2_row][col2]"
45
+ When I fill in "adv_search[2_row][col3]" with "Smith"
46
+
47
+ When I follow "add_row_link_1"
48
+ When I select "age" from "adv_search[3_row][col1]"
49
+ When I select "is equal to" from "adv_search[3_row][col2]"
50
+ When I fill in "adv_search[3_row][col3]" with "40"
51
+
52
+ When I press "Search"
53
+ Then I should see "Search result: 1 record found"
54
+ Then async verify that user "first_name" is "John"
55
+ Then async verify that user "last_name" is "Smith"
56
+
57
+ @javascript
58
+ Scenario: First built two extra rows and then kill the last row
59
+ Given the following user exists:
60
+ | first name | last name | age |
61
+ | Mary | Jane | 30 |
62
+ | Jennifer | Jane | 30 |
63
+ | John | Smith | 40 |
64
+ | John | Smith | 30 |
65
+ Given I visit advance_search page
66
+ When I select "first_name" from "adv_search[1_row][col1]"
67
+ When I select "is exactly" from "adv_search[1_row][col2]"
68
+ When I fill in "adv_search[1_row][col3]" with "John"
69
+
70
+ When I follow "add_row_link_1"
71
+ When I select "last_name" from "adv_search[2_row][col1]"
72
+ When I select "is exactly" from "adv_search[2_row][col2]"
73
+ When I fill in "adv_search[2_row][col3]" with "Smith"
74
+
75
+ When I follow "add_row_link_1"
76
+ When I select "age" from "adv_search[3_row][col1]"
77
+ When I select "is equal to" from "adv_search[3_row][col2]"
78
+ When I fill in "adv_search[3_row][col3]" with "40"
79
+
80
+ Then page should have id "remove_row_3"
81
+
82
+ When I follow "remove_row_3"
83
+ Then I should see "2" rows in table "advance_search_table"
84
+ When I press "Search"
85
+ Then I should see "Search result: 2 records found"
86
+ Then async verify that user "first_name" is "John"
87
+ Then async verify that user "last_name" is "Smith"
@@ -0,0 +1,130 @@
1
+ Feature: Advance Search for string
2
+
3
+ @javascript
4
+ Scenario: Advance Search for a text field
5
+ Given a user exists
6
+ Given I visit advance_search page
7
+ When I select "description" from "adv_search[1_row][col1]"
8
+ Then page should have css "#advance_search_table tr td select.col2"
9
+ When I select "Contains" from "adv_search[1_row][col2]"
10
+ Then page should have css "#advance_search_table tr td input.col3"
11
+ When I select "Doesn't Contain" from "adv_search[1_row][col2]"
12
+ Then page should have css "#advance_search_table tr td input.col3"
13
+ When I select "is null" from "adv_search[1_row][col2]"
14
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
15
+ When I select "is not null" from "adv_search[1_row][col2]"
16
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
17
+
18
+
19
+ @javascript
20
+ Scenario: testing drop down behavior
21
+ Given a user exists
22
+ Given I visit advance_search page
23
+ Then page should have css "#advance_search_form"
24
+ Then page should have css "#advance_search_table"
25
+ Then page should have css "#advance_search_table tr td select.col1"
26
+ When I select "first_name" from "adv_search[1_row][col1]"
27
+ Then page should have css "#advance_search_table tr td select.col2"
28
+ When I select "contains" from "adv_search[1_row][col2]"
29
+ Then page should have css "#advance_search_table tr td input.col3"
30
+ When I select "is exactly" from "adv_search[1_row][col2]"
31
+ Then page should have css "#advance_search_table tr td input.col3"
32
+ When I select "doesn't contain" from "adv_search[1_row][col2]"
33
+ Then page should have css "#advance_search_table tr td input.col3"
34
+ When I select "is null" from "adv_search[1_row][col2]"
35
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
36
+ When I select "is not null" from "adv_search[1_row][col2]"
37
+ #Then page should have disabled css "#advance_search_table tr td input.col3"
38
+
39
+ @javascript
40
+ Scenario: option "is not null"
41
+ Given the following user exists:
42
+ | first name | last name |
43
+ | Mary | Jane |
44
+ | John | |
45
+ Given I visit advance_search page
46
+ When I select "last_name" from "adv_search[1_row][col1]"
47
+ When I select "is not null" from "adv_search[1_row][col2]"
48
+ When I press "Search"
49
+ Then I should see "Search result: 1 record found"
50
+ Then async verify that user "first_name" is "Mary"
51
+ Then async verify that user "last_name" is "Jane"
52
+
53
+ @javascript
54
+ Scenario: option "is null"
55
+ Given the following user exists:
56
+ | first name | last name |
57
+ | John | |
58
+ | Mary | Jane |
59
+ | Jennifer | Jane |
60
+ Given I visit advance_search page
61
+ When I select "last_name" from "adv_search[1_row][col1]"
62
+ When I select "is null" from "adv_search[1_row][col2]"
63
+ When I press "Search"
64
+ Then I should see "Search result: 1 record found"
65
+ Then async verify that user "first_name" is "John"
66
+
67
+ @javascript
68
+ Scenario: option "is exactly"
69
+ Given the following user exists:
70
+ | first name | last name |
71
+ | John | Smith |
72
+ | Mary | Jane |
73
+ | Jennifer | Jane |
74
+ Given I visit advance_search page
75
+ When I select "first_name" from "adv_search[1_row][col1]"
76
+ When I select "is exactly" from "adv_search[1_row][col2]"
77
+ When I fill in "adv_search[1_row][col3]" with "John"
78
+ When I press "Search"
79
+ Then I should see "Search result: 1 record found"
80
+ Then async verify that user "first_name" is "John"
81
+ Then async verify that user "last_name" is "Smith"
82
+
83
+ @javascript
84
+ Scenario: option "contains"
85
+ Given the following user exists:
86
+ | first name | last name |
87
+ | Mary | Jane |
88
+ | Jennifer | Jane |
89
+ | Jenny | Aniston |
90
+ | John | Smith |
91
+ Given I visit advance_search page
92
+ When I select "first_name" from "adv_search[1_row][col1]"
93
+ When I select "contains" from "adv_search[1_row][col2]"
94
+ When I fill in "adv_search[1_row][col3]" with "Jenn"
95
+ When I press "Search"
96
+ Then I should see "Search result: 2 records found"
97
+ Then async verify that user "first_name" is "Jenny"
98
+ Then async verify that user "last_name" is "Aniston"
99
+
100
+ @javascript
101
+ Scenario: search for a text that does not exist
102
+ Given the following user exists:
103
+ | first name | last name |
104
+ | Mary | Jane |
105
+ | Jennifer | Jane |
106
+ | Jenny | Aniston |
107
+ | John | Smith |
108
+ Given I visit advance_search page
109
+ When I select "first_name" from "adv_search[1_row][col1]"
110
+ When I select "contains" from "adv_search[1_row][col2]"
111
+ When I fill in "adv_search[1_row][col3]" with "xxxxxxxxxxxxx"
112
+ When I press "Search"
113
+ Then I should see "Search result: 0 records found"
114
+
115
+ @javascript
116
+ Scenario: option "does not contain"
117
+ Given the following user exists:
118
+ | first name | last name |
119
+ | John | Smith |
120
+ | Mary | Jane |
121
+ | Jennifer | Jane |
122
+ | Jenny | Aniston |
123
+ Given I visit advance_search page
124
+ When I select "first_name" from "adv_search[1_row][col1]"
125
+ When I select "doesn't contain" from "adv_search[1_row][col2]"
126
+ When I fill in "adv_search[1_row][col3]" with "Jenn"
127
+ When I press "Search"
128
+ Then I should see "Search result: 2 records found"
129
+ Then async verify that user "first_name" is "John"
130
+ Then async verify that user "last_name" is "Smith"