activeadmin 1.0.0.pre4 → 1.0.0.pre5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activeadmin might be problematic. Click here for more details.

Files changed (277) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -3
  3. data/.travis.yml +48 -26
  4. data/Appraisals +103 -0
  5. data/CHANGELOG.md +12 -1
  6. data/CONTRIBUTING.md +85 -32
  7. data/Gemfile +13 -38
  8. data/README.md +10 -26
  9. data/Rakefile +41 -9
  10. data/activeadmin.gemspec +7 -4
  11. data/app/assets/javascripts/active_admin/initializers/filters.js.coffee +10 -3
  12. data/app/assets/javascripts/active_admin/jquery_ui.js.erb +11 -4
  13. data/app/assets/javascripts/active_admin/lib/checkbox-toggler.js.coffee +8 -0
  14. data/app/assets/javascripts/active_admin/lib/modal_dialog.js.coffee +1 -1
  15. data/app/assets/javascripts/active_admin/lib/per_page.js.coffee +14 -3
  16. data/app/assets/stylesheets/active_admin/_forms.scss +1 -0
  17. data/app/views/active_admin/devise/registrations/new.html.erb +1 -1
  18. data/codecov.yml +23 -0
  19. data/config/locales/es-MX.yml +1 -1
  20. data/config/locales/es.yml +1 -1
  21. data/config/locales/ru.yml +1 -0
  22. data/config/locales/sk.yml +110 -0
  23. data/docs/0-installation.md +3 -0
  24. data/docs/1-general-configuration.md +11 -0
  25. data/docs/10-custom-pages.md +25 -0
  26. data/docs/11-decorators.md +3 -0
  27. data/docs/12-arbre-components.md +3 -0
  28. data/docs/13-authorization-adapter.md +3 -0
  29. data/docs/14-gotchas.md +19 -0
  30. data/docs/2-resource-customization.md +21 -2
  31. data/docs/3-index-pages.md +21 -0
  32. data/docs/3-index-pages/custom-index.md +3 -0
  33. data/docs/3-index-pages/index-as-block.md +3 -0
  34. data/docs/3-index-pages/index-as-blog.md +3 -0
  35. data/docs/3-index-pages/index-as-grid.md +3 -0
  36. data/docs/3-index-pages/index-as-table.md +22 -0
  37. data/docs/4-csv-format.md +15 -0
  38. data/docs/5-forms.md +7 -3
  39. data/docs/6-show-pages.md +3 -0
  40. data/docs/7-sidebars.md +3 -0
  41. data/docs/8-custom-actions.md +3 -0
  42. data/docs/9-batch-actions.md +4 -1
  43. data/docs/CNAME +1 -0
  44. data/docs/Gemfile +2 -0
  45. data/docs/_config.yml +2 -0
  46. data/docs/_includes/footer.html +8 -0
  47. data/docs/_includes/google-analytics.html +16 -0
  48. data/docs/_includes/head.html +7 -0
  49. data/docs/_includes/toc.html +97 -0
  50. data/docs/_includes/top-menu.html +9 -0
  51. data/docs/_layouts/default.html +21 -0
  52. data/docs/documentation.md +62 -0
  53. data/docs/images/activeadmin.png +0 -0
  54. data/docs/images/code-header.png +0 -0
  55. data/docs/images/divider.png +0 -0
  56. data/docs/images/features.png +0 -0
  57. data/docs/index.html +130 -0
  58. data/docs/stylesheets/main.css +1199 -0
  59. data/features/action_item.feature +2 -2
  60. data/features/authorization_cancan.feature +3 -3
  61. data/features/belongs_to.feature +60 -2
  62. data/features/comments/commenting.feature +7 -7
  63. data/features/development_reloading.feature +1 -1
  64. data/features/edit_page.feature +9 -9
  65. data/features/footer.feature +28 -0
  66. data/features/i18n.feature +11 -0
  67. data/features/index/batch_actions.feature +28 -6
  68. data/features/index/filters.feature +31 -11
  69. data/features/index/format_as_csv.feature +13 -13
  70. data/features/index/formats.feature +4 -4
  71. data/features/index/index_as_block.feature +1 -1
  72. data/features/index/index_as_blog.feature +6 -6
  73. data/features/index/index_as_grid.feature +3 -3
  74. data/features/index/index_as_table.feature +11 -11
  75. data/features/index/index_blank_slate.feature +4 -4
  76. data/features/index/index_parameters.feature +10 -10
  77. data/features/index/index_scope_to.feature +3 -3
  78. data/features/index/index_scopes.feature +37 -18
  79. data/features/index/page_title.feature +3 -3
  80. data/features/index/pagination.feature +1 -1
  81. data/features/index/switch_index_view.feature +8 -8
  82. data/features/menu.feature +3 -3
  83. data/features/new_page.feature +8 -8
  84. data/features/registering_assets.feature +1 -1
  85. data/features/registering_pages.feature +73 -2
  86. data/features/registering_resources.feature +1 -1
  87. data/features/renamed_resource.feature +1 -1
  88. data/features/show/page_title.feature +3 -3
  89. data/features/sidebar_sections.feature +6 -6
  90. data/features/specifying_actions.feature +29 -4
  91. data/features/step_definitions/factory_steps.rb +1 -1
  92. data/features/step_definitions/footer_steps.rb +11 -0
  93. data/features/step_definitions/i18n_steps.rb +8 -0
  94. data/features/step_definitions/index_scope_steps.rb +4 -0
  95. data/features/step_definitions/sidebar_steps.rb +1 -3
  96. data/features/step_definitions/table_steps.rb +1 -5
  97. data/features/step_definitions/user_steps.rb +7 -0
  98. data/features/support/env.rb +6 -33
  99. data/features/support/paths.rb +5 -0
  100. data/features/users/logging_in.feature +2 -0
  101. data/gemfiles/rails_32.gemfile +54 -0
  102. data/gemfiles/rails_40.gemfile +53 -0
  103. data/gemfiles/rails_41.gemfile +53 -0
  104. data/gemfiles/rails_42.gemfile +53 -0
  105. data/gemfiles/rails_50.gemfile +46 -0
  106. data/lib/active_admin.rb +1 -0
  107. data/lib/active_admin/application.rb +11 -0
  108. data/lib/active_admin/batch_actions/resource_extension.rb +0 -8
  109. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
  110. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +1 -1
  111. data/lib/active_admin/dsl.rb +0 -6
  112. data/lib/active_admin/filters/active.rb +9 -1
  113. data/lib/active_admin/filters/formtastic_addons.rb +1 -1
  114. data/lib/active_admin/filters/humanized.rb +1 -1
  115. data/lib/active_admin/filters/resource_extension.rb +2 -4
  116. data/lib/active_admin/form_builder.rb +12 -6
  117. data/lib/active_admin/helpers/collection.rb +2 -0
  118. data/lib/active_admin/inputs.rb +1 -0
  119. data/lib/active_admin/inputs/filters/date_range_input.rb +9 -4
  120. data/lib/active_admin/inputs/filters/text_input.rb +26 -0
  121. data/lib/active_admin/localizers.rb +11 -0
  122. data/lib/active_admin/localizers/resource_localizer.rb +35 -0
  123. data/lib/active_admin/namespace.rb +1 -1
  124. data/lib/active_admin/order_clause.rb +29 -7
  125. data/lib/active_admin/page.rb +18 -4
  126. data/lib/active_admin/page_dsl.rb +4 -0
  127. data/lib/active_admin/resource.rb +16 -1
  128. data/lib/active_admin/resource/action_items.rb +7 -4
  129. data/lib/active_admin/resource/belongs_to.rb +4 -0
  130. data/lib/active_admin/resource/menu.rb +1 -1
  131. data/lib/active_admin/resource/ordering.rb +11 -0
  132. data/lib/active_admin/resource/routes.rb +34 -13
  133. data/lib/active_admin/resource/scopes.rb +1 -0
  134. data/lib/active_admin/resource_controller/data_access.rb +3 -10
  135. data/lib/active_admin/resource_dsl.rb +28 -1
  136. data/lib/active_admin/router.rb +5 -3
  137. data/lib/active_admin/scope.rb +3 -3
  138. data/lib/active_admin/version.rb +1 -1
  139. data/lib/active_admin/view_helpers/auto_link_helper.rb +2 -2
  140. data/lib/active_admin/view_helpers/display_helper.rb +8 -3
  141. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +5 -1
  142. data/lib/active_admin/views/components/active_admin_form.rb +11 -10
  143. data/lib/active_admin/views/components/attributes_table.rb +1 -1
  144. data/lib/active_admin/views/components/columns.rb +3 -3
  145. data/lib/active_admin/views/components/dropdown_menu.rb +2 -2
  146. data/lib/active_admin/views/components/index_list.rb +4 -1
  147. data/lib/active_admin/views/components/paginated_collection.rb +1 -0
  148. data/lib/active_admin/views/components/scopes.rb +8 -1
  149. data/lib/active_admin/views/components/site_title.rb +2 -2
  150. data/lib/active_admin/views/components/table_for.rb +3 -3
  151. data/lib/active_admin/views/footer.rb +17 -3
  152. data/lib/active_admin/views/index_as_table.rb +3 -3
  153. data/lib/active_admin/views/pages/base.rb +4 -2
  154. data/lib/active_admin/views/pages/form.rb +2 -3
  155. data/lib/active_admin/views/pages/show.rb +2 -1
  156. data/lib/bug_report_templates/rails_5_master.rb +120 -0
  157. data/lib/generators/active_admin/devise/devise_generator.rb +6 -3
  158. data/lib/generators/active_admin/install/install_generator.rb +1 -1
  159. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +15 -1
  160. data/lib/generators/active_admin/install/templates/migrations/{create_active_admin_comments.rb → create_active_admin_comments.rb.erb} +14 -1
  161. data/lib/ransack_ext.rb +2 -2
  162. data/spec/bug_report_templates_spec.rb +27 -0
  163. data/spec/javascripts/support/jasmine_runner.rb +4 -17
  164. data/spec/rails_helper.rb +20 -109
  165. data/spec/requests/default_namespace_spec.rb +16 -28
  166. data/spec/requests/javascript_spec.rb +1 -1
  167. data/spec/requests/memory_spec.rb +5 -1
  168. data/spec/requests/stylesheets_spec.rb +1 -1
  169. data/spec/spec_helper.rb +5 -10
  170. data/spec/support/active_admin_integration_spec_helper.rb +66 -0
  171. data/spec/support/active_admin_request_helpers.rb +12 -0
  172. data/spec/support/rails_template.rb +42 -15
  173. data/spec/support/rails_template_with_data.rb +24 -5
  174. data/spec/support/templates/manifest.js +3 -0
  175. data/spec/support/templates/policies/application_policy.rb +1 -1
  176. data/spec/unit/abstract_view_factory_spec.rb +1 -1
  177. data/spec/unit/action_builder_spec.rb +3 -12
  178. data/spec/unit/active_admin_spec.rb +1 -1
  179. data/spec/unit/application_spec.rb +5 -1
  180. data/spec/unit/asset_registration_spec.rb +1 -1
  181. data/spec/unit/authorization/authorization_adapter_spec.rb +1 -1
  182. data/spec/unit/authorization/controller_authorization_spec.rb +13 -9
  183. data/spec/unit/authorization/index_overriding_spec.rb +6 -6
  184. data/spec/unit/auto_link_spec.rb +48 -24
  185. data/spec/unit/batch_actions/resource_spec.rb +1 -14
  186. data/spec/unit/batch_actions/settings_spec.rb +1 -1
  187. data/spec/unit/belongs_to_spec.rb +9 -1
  188. data/spec/unit/cancan_adapter_spec.rb +1 -1
  189. data/spec/unit/comments_spec.rb +26 -19
  190. data/spec/unit/component_spec.rb +1 -1
  191. data/spec/unit/config_shared_examples.rb +1 -1
  192. data/spec/unit/controller_filters_spec.rb +1 -1
  193. data/spec/unit/csv_builder_spec.rb +5 -5
  194. data/spec/unit/dependency_spec.rb +1 -1
  195. data/spec/unit/devise_spec.rb +17 -3
  196. data/spec/unit/dsl_spec.rb +2 -2
  197. data/spec/unit/filters/active_spec.rb +21 -0
  198. data/spec/unit/filters/filter_form_builder_spec.rb +98 -31
  199. data/spec/unit/filters/humanized_spec.rb +9 -1
  200. data/spec/unit/filters/resource_spec.rb +5 -4
  201. data/spec/unit/form_builder_spec.rb +180 -33
  202. data/spec/unit/generators/install_spec.rb +12 -5
  203. data/spec/unit/helpers/collection_spec.rb +10 -7
  204. data/spec/unit/helpers/scope_chain_spec.rb +1 -1
  205. data/spec/unit/helpers/settings_spec.rb +1 -1
  206. data/spec/unit/i18n_spec.rb +1 -1
  207. data/spec/unit/localizers/resource_localizer_spec.rb +36 -0
  208. data/spec/unit/menu_collection_spec.rb +1 -1
  209. data/spec/unit/menu_item_spec.rb +1 -1
  210. data/spec/unit/menu_spec.rb +1 -1
  211. data/spec/unit/namespace/authorization_spec.rb +1 -1
  212. data/spec/unit/namespace/register_page_spec.rb +28 -2
  213. data/spec/unit/namespace/register_resource_spec.rb +3 -1
  214. data/spec/unit/namespace_spec.rb +23 -1
  215. data/spec/unit/order_clause_spec.rb +7 -7
  216. data/spec/unit/page_controller_spec.rb +1 -1
  217. data/spec/unit/page_spec.rb +55 -2
  218. data/spec/unit/pretty_format_spec.rb +8 -7
  219. data/spec/unit/pundit_adapter_spec.rb +1 -1
  220. data/spec/unit/resource/action_items_spec.rb +1 -1
  221. data/spec/unit/resource/includes_spec.rb +1 -1
  222. data/spec/unit/resource/menu_spec.rb +1 -1
  223. data/spec/unit/resource/naming_spec.rb +1 -1
  224. data/spec/unit/resource/ordering_spec.rb +38 -0
  225. data/spec/unit/resource/page_presenters_spec.rb +1 -1
  226. data/spec/unit/resource/pagination_spec.rb +1 -1
  227. data/spec/unit/resource/routes_spec.rb +101 -53
  228. data/spec/unit/resource/scopes_spec.rb +1 -1
  229. data/spec/unit/resource/sidebars_spec.rb +1 -1
  230. data/spec/unit/resource_collection_spec.rb +1 -1
  231. data/spec/unit/resource_controller/data_access_spec.rb +50 -1
  232. data/spec/unit/resource_controller/decorators_spec.rb +2 -2
  233. data/spec/unit/resource_controller/sidebars_spec.rb +16 -17
  234. data/spec/unit/resource_controller_spec.rb +50 -56
  235. data/spec/unit/resource_registration_spec.rb +9 -4
  236. data/spec/unit/resource_spec.rb +9 -1
  237. data/spec/unit/routing_spec.rb +30 -2
  238. data/spec/unit/scope_spec.rb +26 -2
  239. data/spec/unit/settings_spec.rb +2 -2
  240. data/spec/unit/view_factory_spec.rb +1 -1
  241. data/spec/unit/view_helpers/breadcrumbs_spec.rb +1 -1
  242. data/spec/unit/view_helpers/display_helper_spec.rb +18 -3
  243. data/spec/unit/view_helpers/download_format_links_helper_spec.rb +1 -1
  244. data/spec/unit/view_helpers/fields_for_spec.rb +1 -1
  245. data/spec/unit/view_helpers/flash_helper_spec.rb +1 -1
  246. data/spec/unit/view_helpers/form_helper_spec.rb +1 -1
  247. data/spec/unit/view_helpers/method_or_proc_helper_spec.rb +1 -1
  248. data/spec/unit/views/components/attributes_table_spec.rb +1 -1
  249. data/spec/unit/views/components/batch_action_selector_spec.rb +1 -1
  250. data/spec/unit/views/components/blank_slate_spec.rb +1 -1
  251. data/spec/unit/views/components/columns_spec.rb +1 -1
  252. data/spec/unit/views/components/index_list_spec.rb +18 -4
  253. data/spec/unit/views/components/index_table_for_spec.rb +1 -1
  254. data/spec/unit/views/components/paginated_collection_spec.rb +1 -1
  255. data/spec/unit/views/components/panel_spec.rb +1 -1
  256. data/spec/unit/views/components/sidebar_section_spec.rb +1 -1
  257. data/spec/unit/views/components/site_title_spec.rb +1 -1
  258. data/spec/unit/views/components/status_tag_spec.rb +1 -1
  259. data/spec/unit/views/components/table_for_spec.rb +9 -7
  260. data/spec/unit/views/components/tabs_spec.rb +1 -1
  261. data/spec/unit/views/components/unsupported_browser_spec.rb +3 -3
  262. data/spec/unit/views/index_as_blog_spec.rb +1 -1
  263. data/spec/unit/views/pages/form_spec.rb +1 -1
  264. data/spec/unit/views/pages/index_spec.rb +1 -1
  265. data/spec/unit/views/pages/layout_spec.rb +1 -1
  266. data/spec/unit/views/pages/show_spec.rb +1 -1
  267. data/spec/unit/views/tabbed_navigation_spec.rb +2 -2
  268. data/tasks/local.rake +25 -0
  269. data/tasks/parallel_tests.rake +4 -4
  270. data/tasks/test.rake +8 -53
  271. metadata +61 -18
  272. data/Guardfile +0 -8
  273. data/script/local +0 -53
  274. data/script/travis_cache +0 -107
  275. data/script/use_rails +0 -53
  276. data/spec/javascripts/support/jasmine_config.rb +0 -23
  277. data/spec/support/detect_rails_version.rb +0 -34
@@ -11,7 +11,7 @@ Given /^(a|\d+)( published)?( unstarred|starred)? posts?(?: with the title "([^"
11
11
  category = Category.where(name: category_name).first_or_create if category_name
12
12
  title ||= "Hello World %i"
13
13
  count.times do |i|
14
- Post.create! title: title % i, body: body, author: author, published_at: published, custom_category_id: category.try(:id), starred: starred
14
+ Post.create! title: title % i, body: body, author: author, published_date: published, custom_category_id: category.try(:id), starred: starred
15
15
  end
16
16
  end
17
17
 
@@ -0,0 +1,11 @@
1
+ Then /^I should see the default footer$/ do
2
+ expect(page).to have_css '#footer', text: "Powered by Active Admin #{ActiveAdmin::VERSION}"
3
+ end
4
+
5
+ Then /^I should see the footer "([^"]*)"$/ do |footer|
6
+ expect(page).to have_css '#footer', text: footer
7
+ end
8
+
9
+ Then /^I should not see the footer "([^"]*)"$/ do |footer|
10
+ expect(page).to_not have_css '#footer', text: footer
11
+ end
@@ -1,3 +1,11 @@
1
+ Given /^String "([^"]*)" corresponds to "([^"]*)"$/ do |translation, key|
2
+ *seq, last_key = key.split('.')
3
+ result = seq.reverse.inject({last_key.to_sym => translation}) do |temp_result, nested_key|
4
+ {nested_key.to_sym => temp_result}
5
+ end
6
+ I18n.backend.store_translations :en, active_admin: result
7
+ end
8
+
1
9
  When /^I set my locale to "([^"]*)"$/ do |lang|
2
10
  I18n.locale = lang
3
11
  end
@@ -14,6 +14,10 @@ Then /^I should see the scope "([^"]*)" with the count (\d+)$/ do |name, count|
14
14
  step %{I should see "#{count}" within ".scopes .#{name} .count"}
15
15
  end
16
16
 
17
+ Then /^I should see the scope with label "([^"]*)"$/ do |label|
18
+ expect(page).to have_link(label)
19
+ end
20
+
17
21
  Then /^I should see the scope "([^"]*)" with no count$/ do |name|
18
22
  name = name.tr(" ", "").underscore.downcase
19
23
  expect(page).to have_css ".scopes .#{name}"
@@ -3,9 +3,7 @@ Then /^I should see a sidebar titled "([^"]*)"$/ do |title|
3
3
  end
4
4
 
5
5
  Then /^I should not see a sidebar titled "([^"]*)"$/ do |title|
6
- title = title.tr(' ', '').underscore
7
- sidebars = page.all :css, "##{title}_sidebar_section"
8
- expect(sidebars.count).to eq 0
6
+ expect(page).not_to have_css '.sidebar_section h3', text: title
9
7
  end
10
8
 
11
9
  Then(/^I should see a sidebar titled "(.*?)" above sidebar titled "(.*?)"$/) do |top_title, bottom_title|
@@ -59,8 +59,6 @@ class HtmlTableToTextHelper
59
59
  end
60
60
 
61
61
  module TableMatchHelper
62
-
63
-
64
62
  # @param table [Array[Array]]
65
63
  # @param expected_table [Array[Array[String]]]
66
64
  # The expected_table values are String. They are converted to
@@ -97,12 +95,10 @@ module TableMatchHelper
97
95
  expect((cell || "").strip).to eq expected_cell
98
96
  end
99
97
  end
100
-
101
- end # module TableMatchHelper
98
+ end
102
99
 
103
100
  World(TableMatchHelper)
104
101
 
105
-
106
102
  # Usage:
107
103
  #
108
104
  # I should see the "invoices" table:
@@ -40,6 +40,13 @@ Given /^"([^"]*)" requests a password reset with token "([^"]*)"( but it expires
40
40
  AdminUser.where(email: email).first.update_attribute :reset_password_sent_at, 1.month.ago if expired
41
41
  end
42
42
 
43
+ Given /^override locale "([^"]*)" with "([^"]*)"$/ do |path, value|
44
+ keys_value = path.split('.') + [value]
45
+ locale_hash = keys_value.reverse.inject{|a,n| {n=>a}}
46
+ I18n.available_locales
47
+ I18n.backend.store_translations(I18n.locale, locale_hash)
48
+ end
49
+
43
50
  When /^I fill in the password field with "([^"]*)"$/ do |password|
44
51
  fill_in 'admin_user_password', with: password
45
52
  end
@@ -8,14 +8,14 @@ ENV['RAILS_ENV'] = 'test'
8
8
 
9
9
  require File.expand_path('../../../spec/spec_helper', __FILE__)
10
10
 
11
- ENV['RAILS_ROOT'] = File.expand_path("../../../spec/rails/rails-#{ENV["RAILS"]}", __FILE__)
11
+ require 'rails'
12
+ ENV['RAILS_ROOT'] = File.expand_path("../../../spec/rails/rails-#{Rails.version}", __FILE__)
12
13
 
13
14
  # Create the test app if it doesn't exists
14
15
  unless File.exists?(ENV['RAILS_ROOT'])
15
16
  system 'rake setup'
16
17
  end
17
18
 
18
- require 'rails'
19
19
  require 'active_record'
20
20
  require 'active_admin'
21
21
  require 'devise'
@@ -23,8 +23,7 @@ ActiveAdmin.application.load_paths = [ENV['RAILS_ROOT'] + "/app/admin"]
23
23
 
24
24
  require ENV['RAILS_ROOT'] + '/config/environment'
25
25
 
26
- # Setup autoloading of ActiveAdmin and the load path
27
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
26
+ # Setup autoloading of ActiveAdmin
28
27
  autoload :ActiveAdmin, 'active_admin'
29
28
 
30
29
  require 'cucumber/rails'
@@ -72,35 +71,9 @@ Capybara.ignore_hidden_elements = false
72
71
  # of your scenarios, as this makes it hard to discover errors in your application.
73
72
  ActionController::Base.allow_rescue = false
74
73
 
75
- # If you set this to true, each scenario will run in a database transaction.
76
- # You can still turn off transactions on a per-scenario basis, simply tagging
77
- # a feature or scenario with the @no-txn tag. If you are using Capybara,
78
- # tagging with @culerity or @javascript will also turn transactions off.
79
- #
80
- # If you set this to false, transactions will be off for all scenarios,
81
- # regardless of whether you use @no-txn or not.
82
- #
83
- # Beware that turning transactions off will leave data in your database
84
- # after each scenario, which can lead to hard-to-debug failures in
85
- # subsequent scenarios. If you do this, we recommend you create a Before
86
- # block that will explicitly put your database in a known state.
87
- if ActiveAdmin::Dependency.rails5?
88
- Cucumber::Rails::World.use_transactional_tests = true
89
- else
90
- Cucumber::Rails::World.use_transactional_fixtures = true
91
- end
92
-
93
- # How to clean your database when transactions are turned off. See
94
- # http://github.com/bmabey/database_cleaner for more info.
95
- if defined?(ActiveRecord::Base)
96
- begin
97
- require 'database_cleaner'
98
- require 'database_cleaner/cucumber'
99
- DatabaseCleaner.strategy = :truncation
100
- rescue LoadError
101
- # ignore if database_cleaner isn't present
102
- end
103
- end
74
+ # Database resetting strategy
75
+ DatabaseCleaner.strategy = :truncation
76
+ Cucumber::Rails::Database.javascript_strategy = :truncation
104
77
 
105
78
  # Warden helpers to speed up login
106
79
  # See https://github.com/plataformatec/devise/wiki/How-To:-Test-with-Capybara
@@ -21,6 +21,8 @@ module NavigationHelpers
21
21
  "/admin/login"
22
22
  when /the first post show page/
23
23
  "/admin/posts/1"
24
+ when /the first post custom status page/
25
+ "/admin/posts/1/status"
24
26
  when /the first post edit page/
25
27
  "/admin/posts/1/edit"
26
28
  when /the admin password reset form with token "([^"]*)"/
@@ -45,6 +47,9 @@ module NavigationHelpers
45
47
  when /^the last author's last post page$/
46
48
  admin_user_post_path(User.last, Post.where(author_id: User.last.id).last)
47
49
 
50
+ when /^the last post's show page$/
51
+ admin_post_path(Post.last)
52
+
48
53
  when /^the last post's edit page$/
49
54
  edit_admin_post_path(Post.last)
50
55
 
@@ -20,6 +20,7 @@ Feature: User Logging In
20
20
  And I should see the element "a[href='/admin/admin_users/1']:contains('admin@example.com')"
21
21
 
22
22
  Scenario: Attempting to log in with an incorrect email address
23
+ Given override locale "devise.failure.not_found_in_database" with "Invalid email or password."
23
24
  When I fill in "Email" with "not-an-admin@example.com"
24
25
  And I fill in "Password" with "not-my-password"
25
26
  And I press "Login"
@@ -27,6 +28,7 @@ Feature: User Logging In
27
28
  And I should see "Invalid email or password."
28
29
 
29
30
  Scenario: Attempting to log in with an incorrect password
31
+ Given override locale "devise.failure.invalid" with "Invalid email or password."
30
32
  When I fill in "Email" with "admin@example.com"
31
33
  And I fill in "Password" with "not-my-password"
32
34
  And I press "Login"
@@ -0,0 +1,54 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "cancan"
6
+ gem "pundit"
7
+ gem "thor", "<= 0.19.1"
8
+ gem "rake"
9
+ gem "parallel_tests", "< 2.10"
10
+ gem "pry"
11
+ gem "rails", "3.2.22"
12
+ gem "jquery-ui-rails", "~> 4.0"
13
+ gem "devise", "~> 3.5"
14
+ gem "inherited_resources"
15
+ gem "test-unit", "~> 3.0"
16
+ gem "draper", "~> 2.1"
17
+ gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
18
+
19
+ group :development do
20
+ gem "better_errors", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
21
+ gem "binding_of_caller", :platforms => :mri
22
+ gem "rack-mini-profiler"
23
+ gem "yard"
24
+ gem "redcarpet", :platforms => :mri
25
+ gem "kramdown", :platforms => :jruby
26
+ gem "appraisal", :require => false
27
+ end
28
+
29
+ group :test do
30
+ gem "capybara"
31
+ gem "simplecov", :require => false
32
+ gem "codecov", :require => false
33
+ gem "cucumber-rails", :require => false
34
+ gem "cucumber", "1.3.20"
35
+ gem "database_cleaner"
36
+ gem "jasmine"
37
+ gem "jslint_on_rails"
38
+ gem "launchy"
39
+ gem "rails-i18n"
40
+ gem "rspec-rails"
41
+ gem "i18n-spec"
42
+ gem "shoulda-matchers", "<= 2.8.0"
43
+ gem "sqlite3", :platforms => :mri
44
+ gem "poltergeist"
45
+ end
46
+
47
+ platforms :ruby_19 do
48
+ gem "kaminari", "~> 0.15"
49
+ gem "mime-types", "< 3"
50
+ gem "nokogiri", "< 1.7"
51
+ gem "public_suffix", "< 1.5"
52
+ end
53
+
54
+ gemspec :path => "../"
@@ -0,0 +1,53 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "cancan"
6
+ gem "pundit"
7
+ gem "thor", "<= 0.19.1"
8
+ gem "rake"
9
+ gem "parallel_tests", "< 2.10"
10
+ gem "pry"
11
+ gem "rails", "4.0.13"
12
+ gem "jquery-ui-rails", "~> 5.0"
13
+ gem "devise", "~> 3.5"
14
+ gem "inherited_resources"
15
+ gem "draper", "~> 2.1"
16
+ gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
17
+
18
+ group :development do
19
+ gem "better_errors", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
20
+ gem "binding_of_caller", :platforms => :mri
21
+ gem "rack-mini-profiler"
22
+ gem "yard"
23
+ gem "redcarpet", :platforms => :mri
24
+ gem "kramdown", :platforms => :jruby
25
+ gem "appraisal", :require => false
26
+ end
27
+
28
+ group :test do
29
+ gem "capybara"
30
+ gem "simplecov", :require => false
31
+ gem "codecov", :require => false
32
+ gem "cucumber-rails", :require => false
33
+ gem "cucumber", "1.3.20"
34
+ gem "database_cleaner"
35
+ gem "jasmine"
36
+ gem "jslint_on_rails"
37
+ gem "launchy"
38
+ gem "rails-i18n"
39
+ gem "rspec-rails"
40
+ gem "i18n-spec"
41
+ gem "shoulda-matchers", "<= 2.8.0"
42
+ gem "sqlite3", :platforms => :mri
43
+ gem "poltergeist"
44
+ end
45
+
46
+ platforms :ruby_19 do
47
+ gem "kaminari", "~> 0.15"
48
+ gem "mime-types", "< 3"
49
+ gem "nokogiri", "< 1.7"
50
+ gem "public_suffix", "< 1.5"
51
+ end
52
+
53
+ gemspec :path => "../"
@@ -0,0 +1,53 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "cancan"
6
+ gem "pundit"
7
+ gem "thor", "<= 0.19.1"
8
+ gem "rake"
9
+ gem "parallel_tests", "< 2.10"
10
+ gem "pry"
11
+ gem "rails", "4.1.16"
12
+ gem "jquery-ui-rails", "~> 5.0"
13
+ gem "devise", "~> 3.5"
14
+ gem "inherited_resources"
15
+ gem "draper", "~> 2.1"
16
+ gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
17
+
18
+ group :development do
19
+ gem "better_errors", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
20
+ gem "binding_of_caller", :platforms => :mri
21
+ gem "rack-mini-profiler"
22
+ gem "yard"
23
+ gem "redcarpet", :platforms => :mri
24
+ gem "kramdown", :platforms => :jruby
25
+ gem "appraisal", :require => false
26
+ end
27
+
28
+ group :test do
29
+ gem "capybara"
30
+ gem "simplecov", :require => false
31
+ gem "codecov", :require => false
32
+ gem "cucumber-rails", :require => false
33
+ gem "cucumber", "1.3.20"
34
+ gem "database_cleaner"
35
+ gem "jasmine"
36
+ gem "jslint_on_rails"
37
+ gem "launchy"
38
+ gem "rails-i18n"
39
+ gem "rspec-rails"
40
+ gem "i18n-spec"
41
+ gem "shoulda-matchers", "<= 2.8.0"
42
+ gem "sqlite3", :platforms => :mri
43
+ gem "poltergeist"
44
+ end
45
+
46
+ platforms :ruby_19 do
47
+ gem "kaminari", "~> 0.15"
48
+ gem "mime-types", "< 3"
49
+ gem "nokogiri", "< 1.7"
50
+ gem "public_suffix", "< 1.5"
51
+ end
52
+
53
+ gemspec :path => "../"
@@ -0,0 +1,53 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "cancan"
6
+ gem "pundit"
7
+ gem "thor", "<= 0.19.1"
8
+ gem "rake"
9
+ gem "parallel_tests", "< 2.10"
10
+ gem "pry"
11
+ gem "rails", "4.2.8.rc1"
12
+ gem "jquery-ui-rails", "~> 5.0"
13
+ gem "devise", "~> 3.5"
14
+ gem "inherited_resources"
15
+ gem "draper", "~> 2.1"
16
+ gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
17
+
18
+ group :development do
19
+ gem "better_errors", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
20
+ gem "binding_of_caller", :platforms => :mri
21
+ gem "rack-mini-profiler"
22
+ gem "yard"
23
+ gem "redcarpet", :platforms => :mri
24
+ gem "kramdown", :platforms => :jruby
25
+ gem "appraisal", :require => false
26
+ end
27
+
28
+ group :test do
29
+ gem "capybara"
30
+ gem "simplecov", :require => false
31
+ gem "codecov", :require => false
32
+ gem "cucumber-rails", :require => false
33
+ gem "cucumber", "1.3.20"
34
+ gem "database_cleaner"
35
+ gem "jasmine"
36
+ gem "jslint_on_rails"
37
+ gem "launchy"
38
+ gem "rails-i18n"
39
+ gem "rspec-rails"
40
+ gem "i18n-spec"
41
+ gem "shoulda-matchers", "<= 2.8.0"
42
+ gem "sqlite3", :platforms => :mri
43
+ gem "poltergeist"
44
+ end
45
+
46
+ platforms :ruby_19 do
47
+ gem "kaminari", "~> 0.15"
48
+ gem "mime-types", "< 3"
49
+ gem "nokogiri", "< 1.7"
50
+ gem "public_suffix", "< 1.5"
51
+ end
52
+
53
+ gemspec :path => "../"
@@ -0,0 +1,46 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "cancan"
6
+ gem "pundit"
7
+ gem "thor", "<= 0.19.1"
8
+ gem "rake"
9
+ gem "parallel_tests", "< 2.10"
10
+ gem "pry"
11
+ gem "rails", "5.0.1"
12
+ gem "jquery-ui-rails", "~> 5.0"
13
+ gem "devise", "> 4.x"
14
+ gem "inherited_resources", :git => "https://github.com/activeadmin/inherited_resources"
15
+ gem "draper", "> 3.x"
16
+ gem "activerecord-jdbcsqlite3-adapter", :git => "https://github.com/jruby/activerecord-jdbc-adapter", :branch => "rails-5", :platforms => :jruby
17
+
18
+ group :development do
19
+ gem "better_errors", :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24]
20
+ gem "binding_of_caller", :platforms => :mri
21
+ gem "rack-mini-profiler"
22
+ gem "yard"
23
+ gem "redcarpet", :platforms => :mri
24
+ gem "kramdown", :platforms => :jruby
25
+ gem "appraisal", :require => false
26
+ end
27
+
28
+ group :test do
29
+ gem "capybara"
30
+ gem "simplecov", :require => false
31
+ gem "codecov", :require => false
32
+ gem "cucumber-rails", :require => false
33
+ gem "cucumber", "1.3.20"
34
+ gem "database_cleaner"
35
+ gem "jasmine"
36
+ gem "jslint_on_rails"
37
+ gem "launchy"
38
+ gem "rails-i18n"
39
+ gem "rspec-rails"
40
+ gem "i18n-spec"
41
+ gem "shoulda-matchers", "<= 2.8.0"
42
+ gem "sqlite3", :platforms => :mri
43
+ gem "poltergeist"
44
+ end
45
+
46
+ gemspec :path => "../"