activeadmin 0.6.0 → 0.6.1
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.
- data/.gitignore +5 -1
- data/.travis.yml +1 -1
- data/.yardopts +2 -3
- data/CHANGELOG.md +180 -36
- data/CONTRIBUTING.md +12 -2
- data/Gemfile +9 -3
- data/README.rdoc +38 -65
- data/Rakefile +1 -3
- data/activeadmin.gemspec +10 -11
- data/app/assets/images/active_admin/index_list_icons/block_icon.svg +1 -1
- data/app/assets/images/active_admin/index_list_icons/blog_icon.svg +1 -1
- data/app/assets/images/active_admin/index_list_icons/grid_icon.svg +1 -1
- data/app/assets/images/active_admin/index_list_icons/table_icon.svg +1 -1
- data/app/assets/javascripts/active_admin/components/jquery.aa.checkbox-toggler.js.coffee +2 -2
- data/app/assets/javascripts/active_admin/components/jquery.aa.dropdown-menu.js.coffee +2 -2
- data/app/assets/javascripts/active_admin/components/jquery.aa.popover.js.coffee +2 -2
- data/app/assets/javascripts/active_admin/components/jquery.aa.table-checkbox-toggler.js.coffee +2 -2
- data/app/assets/javascripts/active_admin/lib/namespace.js.coffee +2 -1
- data/app/assets/javascripts/active_admin/pages/application.js.coffee +6 -1
- data/app/assets/stylesheets/active_admin/_base.css.scss +29 -34
- data/app/assets/stylesheets/active_admin/_forms.css.scss +65 -62
- data/app/assets/stylesheets/active_admin/_header.css.scss +57 -45
- data/app/assets/stylesheets/active_admin/_typography.css.scss +9 -9
- data/app/assets/stylesheets/active_admin/components/_batch_actions.css.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_blank_slates.scss +5 -5
- data/app/assets/stylesheets/active_admin/components/_breadcrumbs.scss +2 -2
- data/app/assets/stylesheets/active_admin/components/_comments.css.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_date_picker.css.scss +20 -20
- data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +16 -16
- data/app/assets/stylesheets/active_admin/components/_flash_messages.css.scss +25 -23
- data/app/assets/stylesheets/active_admin/components/_grid.scss +2 -2
- data/app/assets/stylesheets/active_admin/components/_index_list.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_pagination.scss +10 -10
- data/app/assets/stylesheets/active_admin/components/_panels.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_popovers.css.scss +27 -27
- data/app/assets/stylesheets/active_admin/components/_scopes.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_table_tools.css.scss +10 -10
- data/app/assets/stylesheets/active_admin/components/_tables.css.scss +9 -9
- data/app/assets/stylesheets/active_admin/mixins/_buttons.css.scss +3 -3
- data/app/assets/stylesheets/active_admin/mixins/_gradients.css.scss +4 -4
- data/app/assets/stylesheets/active_admin/mixins/_icons.css.scss +4 -7
- data/app/assets/stylesheets/active_admin/mixins/_reset.css.scss +5 -5
- data/app/assets/stylesheets/active_admin/mixins/_rounded.css.scss +3 -3
- data/app/assets/stylesheets/active_admin/mixins/_sections.css.scss +6 -6
- data/app/assets/stylesheets/active_admin/mixins/_shadows.css.scss +8 -8
- data/app/assets/stylesheets/active_admin/mixins/_typography.scss +1 -1
- data/app/assets/stylesheets/active_admin/mixins/_utilities.scss +1 -1
- data/app/assets/stylesheets/active_admin/mixins/_variables.css.scss +9 -1
- data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +1 -1
- data/app/assets/stylesheets/active_admin/print.css.scss +2 -8
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +5 -5
- data/app/assets/stylesheets/active_admin/structure/_main_structure.scss +13 -13
- data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +14 -14
- data/app/views/active_admin/devise/passwords/edit.html.erb +1 -1
- data/app/views/active_admin/devise/sessions/new.html.erb +1 -1
- data/app/views/active_admin/devise/shared/_links.erb +8 -1
- data/app/views/active_admin/resource/index.csv.erb +3 -3
- data/app/views/layouts/active_admin_logged_out.html.erb +5 -3
- data/config/locales/bg.yml +101 -0
- data/{lib/active_admin → config}/locales/ca.yml +24 -7
- data/{lib/active_admin → config}/locales/cs.yml +34 -12
- data/{lib/active_admin → config}/locales/da.yml +29 -7
- data/config/locales/de-CH.yml +117 -0
- data/{lib/active_admin → config}/locales/de.yml +19 -9
- data/config/locales/en-GB.yml +90 -0
- data/{lib/active_admin → config}/locales/en.yml +16 -6
- data/config/locales/es.yml +106 -0
- data/{lib/active_admin/locales/es.yml → config/locales/es_MX.yml} +14 -8
- data/{lib/active_admin → config}/locales/fr.yml +14 -6
- data/{lib/active_admin → config}/locales/he.yml +16 -6
- data/{lib/active_admin → config}/locales/hr.yml +14 -6
- data/{lib/active_admin → config}/locales/hu.yml +31 -6
- data/{lib/active_admin → config}/locales/it.yml +14 -6
- data/{lib/active_admin → config}/locales/ja.yml +32 -7
- data/{lib/active_admin → config}/locales/ko.yml +14 -6
- data/{lib/active_admin → config}/locales/lt.yml +15 -6
- data/{lib/active_admin → config}/locales/lv.yml +14 -6
- data/{lib/active_admin → config}/locales/nl.yml +14 -6
- data/{lib/active_admin → config}/locales/no-NB.yml +14 -6
- data/{lib/active_admin → config}/locales/pl.yml +14 -6
- data/{lib/active_admin → config}/locales/pt-BR.yml +14 -6
- data/{lib/active_admin → config}/locales/pt-PT.yml +14 -6
- data/{lib/active_admin → config}/locales/ro.yml +32 -7
- data/{lib/active_admin → config}/locales/ru.yml +30 -8
- data/{lib/active_admin → config}/locales/sv-SE.yml +14 -6
- data/{lib/active_admin → config}/locales/tr.yml +15 -6
- data/config/locales/uk.yml +100 -0
- data/{lib/active_admin → config}/locales/vi.yml +15 -6
- data/{lib/active_admin → config}/locales/zh-CN.yml +15 -6
- data/{lib/active_admin → config}/locales/zh-TW.yml +15 -6
- data/docs/0-installation.md +22 -18
- data/docs/1-general-configuration.md +1 -1
- data/docs/10-custom-pages.md +3 -3
- data/docs/11-decorators.md +18 -2
- data/docs/12-arbre-components.md +53 -54
- data/docs/13-authorization-adapter.md +31 -10
- data/docs/2-resource-customization.md +16 -1
- data/docs/3-index-pages.md +13 -1
- data/docs/3-index-pages/create-an-index.md +4 -4
- data/docs/3-index-pages/index-as-block.md +1 -1
- data/docs/3-index-pages/index-as-blog.md +1 -1
- data/docs/3-index-pages/index-as-grid.md +1 -1
- data/docs/4-csv-format.md +4 -4
- data/docs/5-forms.md +46 -3
- data/docs/{6-show-screens.md → 6-show-pages.md} +3 -3
- data/docs/8-custom-actions.md +3 -3
- data/docs/9-batch-actions.md +9 -1
- data/features/action_item.feature +6 -6
- data/features/authorization_cancan.feature +1 -1
- data/features/belongs_to.feature +3 -3
- data/features/breadcrumb.feature +2 -2
- data/features/comments/commenting.feature +7 -5
- data/features/dashboard.feature +0 -51
- data/features/favicon.feature +20 -0
- data/features/global_navigation.feature +0 -1
- data/features/index/batch_actions.feature +12 -11
- data/features/index/filters.feature +6 -6
- data/features/index/format_as_csv.feature +4 -5
- data/features/index/index_as_blog.feature +20 -1
- data/features/index/index_as_table.feature +1 -1
- data/features/index/index_blank_slate.feature +3 -3
- data/features/index/index_parameters.feature +4 -10
- data/features/index/index_scope_to.feature +24 -0
- data/features/index/index_scopes.feature +17 -5
- data/features/index/pagination.feature +15 -0
- data/features/registering_pages.feature +1 -1
- data/features/registering_resources.feature +2 -2
- data/features/show/default_content.feature +3 -3
- data/features/sidebar_sections.feature +3 -3
- data/features/specifying_actions.feature +1 -1
- data/features/step_definitions/additional_web_steps.rb +3 -16
- data/features/step_definitions/asset_steps.rb +5 -1
- data/features/step_definitions/attribute_steps.rb +4 -4
- data/features/step_definitions/batch_action_steps.rb +25 -74
- data/features/step_definitions/breadcrumb_steps.rb +1 -3
- data/features/step_definitions/comment_steps.rb +0 -1
- data/features/step_definitions/configuration_steps.rb +53 -69
- data/features/step_definitions/dashboard_steps.rb +2 -2
- data/features/step_definitions/factory_steps.rb +17 -33
- data/features/step_definitions/filter_steps.rb +2 -2
- data/features/step_definitions/format_steps.rb +10 -14
- data/features/step_definitions/index_scope_steps.rb +9 -25
- data/features/step_definitions/index_views_steps.rb +1 -1
- data/features/step_definitions/sidebar_steps.rb +2 -1
- data/features/step_definitions/site_title_steps.rb +1 -1
- data/features/step_definitions/table_steps.rb +6 -1
- data/features/step_definitions/user_steps.rb +23 -38
- data/features/step_definitions/web_steps.rb +18 -147
- data/features/support/env.rb +13 -34
- data/features/support/paths.rb +2 -0
- data/features/users/logging_in.feature +2 -2
- data/features/users/logging_out.feature +0 -12
- data/features/users/resetting_password.feature +1 -1
- data/lib/active_admin.rb +4 -17
- data/lib/active_admin/abstract_view_factory.rb +1 -1
- data/lib/active_admin/application.rb +19 -28
- data/lib/active_admin/asset_registration.rb +7 -25
- data/lib/active_admin/authorization_adapter.rb +9 -5
- data/lib/active_admin/base_controller.rb +2 -2
- data/lib/active_admin/base_controller/authorization.rb +25 -27
- data/lib/active_admin/batch_actions/resource_extension.rb +3 -3
- data/lib/active_admin/batch_actions/views/batch_action_selector.rb +1 -1
- data/lib/active_admin/batch_actions/views/selection_cells.rb +1 -1
- data/lib/active_admin/callbacks.rb +1 -1
- data/lib/active_admin/cancan_adapter.rb +2 -2
- data/lib/active_admin/comments.rb +32 -38
- data/lib/active_admin/comments/comment.rb +6 -8
- data/lib/active_admin/comments/views.rb +0 -1
- data/lib/active_admin/comments/views/active_admin_comments.rb +27 -38
- data/lib/active_admin/csv_builder.rb +4 -6
- data/lib/active_admin/dependency_checker.rb +4 -0
- data/lib/active_admin/deprecation.rb +3 -3
- data/lib/active_admin/dsl.rb +5 -5
- data/lib/active_admin/engine.rb +1 -1
- data/lib/active_admin/filters.rb +2 -1
- data/lib/active_admin/filters/forms.rb +36 -43
- data/lib/active_admin/filters/formtastic_addons.rb +45 -0
- data/lib/active_admin/filters/resource_extension.rb +9 -1
- data/lib/active_admin/form_builder.rb +30 -19
- data/lib/active_admin/helpers/optional_display.rb +11 -13
- data/lib/active_admin/helpers/settings.rb +50 -8
- data/lib/active_admin/inputs/filter_base.rb +5 -18
- data/lib/active_admin/inputs/filter_base/search_method_select.rb +73 -0
- data/lib/active_admin/inputs/filter_boolean_input.rb +6 -14
- data/lib/active_admin/inputs/filter_check_boxes_input.rb +1 -1
- data/lib/active_admin/inputs/filter_numeric_input.rb +2 -47
- data/lib/active_admin/inputs/filter_select_input.rb +32 -10
- data/lib/active_admin/inputs/filter_string_input.rb +12 -14
- data/lib/active_admin/namespace.rb +8 -40
- data/lib/active_admin/page.rb +2 -2
- data/lib/active_admin/page_dsl.rb +1 -1
- data/lib/active_admin/reloader.rb +3 -3
- data/lib/active_admin/resource.rb +16 -23
- data/lib/active_admin/resource/belongs_to.rb +8 -5
- data/lib/active_admin/resource/menu.rb +10 -23
- data/lib/active_admin/resource/naming.rb +3 -3
- data/lib/active_admin/resource/page_presenters.rb +2 -2
- data/lib/active_admin/resource/routes.rb +74 -21
- data/lib/active_admin/resource/scope_to.rb +74 -0
- data/lib/active_admin/resource/scopes.rb +8 -4
- data/lib/active_admin/resource_collection.rb +20 -66
- data/lib/active_admin/resource_controller.rb +12 -16
- data/lib/active_admin/resource_controller/data_access.rb +19 -22
- data/lib/active_admin/resource_controller/resource_class_methods.rb +2 -2
- data/lib/active_admin/resource_controller/scoping.rb +4 -9
- data/lib/active_admin/resource_dsl.rb +5 -32
- data/lib/active_admin/router.rb +34 -47
- data/lib/active_admin/scope.rb +5 -3
- data/lib/active_admin/sidebar_section.rb +1 -1
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_factory.rb +1 -1
- data/lib/active_admin/view_helpers/auto_link_helper.rb +1 -1
- data/lib/active_admin/view_helpers/breadcrumb_helper.rb +8 -8
- data/lib/active_admin/view_helpers/display_helper.rb +15 -6
- data/lib/active_admin/view_helpers/download_format_links_helper.rb +2 -2
- data/lib/active_admin/view_helpers/form_helper.rb +6 -1
- data/lib/active_admin/view_helpers/icon_helper.rb +1 -1
- data/lib/active_admin/view_helpers/method_or_proc_helper.rb +5 -5
- data/lib/active_admin/view_helpers/title_helper.rb +1 -1
- data/lib/active_admin/views/components/action_list_popover.rb +6 -6
- data/lib/active_admin/views/components/attributes_table.rb +9 -12
- data/lib/active_admin/views/components/blank_slate.rb +4 -4
- data/lib/active_admin/views/components/columns.rb +1 -1
- data/lib/active_admin/views/components/index_list.rb +1 -1
- data/lib/active_admin/views/components/paginated_collection.rb +20 -12
- data/lib/active_admin/views/components/panel.rb +1 -1
- data/lib/active_admin/views/components/scopes.rb +2 -1
- data/lib/active_admin/views/components/sidebar_section.rb +1 -1
- data/lib/active_admin/views/components/status_tag.rb +1 -1
- data/lib/active_admin/views/header.rb +2 -2
- data/lib/active_admin/views/index_as_blog.rb +16 -3
- data/lib/active_admin/views/index_as_table.rb +2 -2
- data/lib/active_admin/views/pages/base.rb +8 -3
- data/lib/active_admin/views/pages/form.rb +2 -2
- data/lib/active_admin/views/pages/index.rb +19 -17
- data/lib/generators/active_admin/assets/templates/3.0/active_admin.js +1 -1
- data/lib/generators/active_admin/assets/templates/3.1/active_admin.css.scss +1 -13
- data/lib/generators/active_admin/devise/devise_generator.rb +22 -1
- data/lib/generators/active_admin/install/install_generator.rb +1 -5
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +40 -19
- data/lib/generators/active_admin/install/templates/admin_user.rb.erb +18 -18
- data/lib/generators/active_admin/install/templates/migrations/create_active_admin_comments.rb +19 -0
- data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
- data/lib/generators/active_admin/resource/templates/admin.rb +1 -1
- data/script/use_rails +1 -1
- data/spec/integration/memory_spec.rb +3 -2
- data/spec/javascripts/coffeescripts/jquery.aa.checkbox-toggler-spec.js.coffee +4 -4
- data/spec/javascripts/coffeescripts/jquery.aa.popover-spec.js.coffee +1 -1
- data/spec/javascripts/coffeescripts/jquery.aa.table-checkbox-toggler-spec.js.coffee +2 -2
- data/spec/javascripts/compiled/jquery.aa.checkbox-toggler-spec.js +4 -4
- data/spec/javascripts/compiled/jquery.aa.popover-spec.js +1 -1
- data/spec/javascripts/compiled/jquery.aa.table-checkbox-toggler-spec.js +2 -2
- data/spec/spec_helper.rb +16 -6
- data/spec/spec_helper_without_rails.rb +2 -0
- data/spec/support/deferred_garbage_collection.rb +19 -0
- data/spec/support/jslint.yml +1 -1
- data/spec/support/rails_template.rb +29 -27
- data/spec/support/templates/admin/stores.rb +5 -1
- data/spec/unit/abstract_view_factory_spec.rb +1 -1
- data/spec/unit/action_builder_spec.rb +7 -7
- data/spec/unit/active_admin_spec.rb +0 -14
- data/spec/unit/application_spec.rb +16 -17
- data/spec/unit/asset_registration_spec.rb +21 -8
- data/spec/unit/authorization/authorization_adapter_spec.rb +3 -3
- data/spec/unit/authorization/controller_authorization_spec.rb +16 -24
- data/spec/unit/batch_actions/resource_spec.rb +11 -11
- data/spec/unit/belongs_to_spec.rb +1 -1
- data/spec/unit/cancan_adapter_spec.rb +11 -3
- data/spec/unit/comments_spec.rb +10 -28
- data/spec/unit/controller_filters_spec.rb +22 -24
- data/spec/unit/csv_builder_spec.rb +3 -3
- data/spec/unit/devise_spec.rb +10 -10
- data/spec/unit/filters/filter_form_builder_spec.rb +140 -45
- data/spec/unit/filters/resource_spec.rb +20 -19
- data/spec/unit/form_builder_spec.rb +122 -70
- data/spec/unit/menu_item_spec.rb +3 -3
- data/spec/unit/namespace/authorization_spec.rb +4 -8
- data/spec/unit/namespace/register_page_spec.rb +1 -1
- data/spec/unit/namespace/register_resource_spec.rb +12 -7
- data/spec/unit/namespace_spec.rb +4 -10
- data/spec/unit/page_spec.rb +1 -1
- data/spec/unit/resource/menu_spec.rb +1 -1
- data/spec/unit/resource/naming_spec.rb +9 -0
- data/spec/unit/resource/pagination_spec.rb +2 -2
- data/spec/unit/resource/routes_spec.rb +73 -0
- data/spec/unit/resource/scopes_spec.rb +1 -1
- data/spec/unit/resource_collection_spec.rb +95 -43
- data/spec/unit/resource_registration_spec.rb +3 -12
- data/spec/unit/resource_spec.rb +41 -48
- data/spec/unit/routing_spec.rb +10 -64
- data/spec/unit/scope_spec.rb +19 -0
- data/spec/unit/settings_spec.rb +88 -0
- data/spec/unit/view_factory_spec.rb +1 -0
- data/spec/unit/{breadcrumbs_spec.rb → view_helpers/breadcrumbs_spec.rb} +16 -7
- data/spec/unit/view_helpers/display_name_spec.rb +41 -0
- data/spec/unit/view_helpers/form_helper_spec.rb +36 -2
- data/spec/unit/views/components/attributes_table_spec.rb +17 -9
- data/spec/unit/views/components/batch_action_popover_spec.rb +4 -4
- data/spec/unit/views/components/index_list_spec.rb +2 -2
- data/spec/unit/views/components/paginated_collection_spec.rb +42 -0
- data/spec/unit/views/components/panel_spec.rb +8 -0
- data/spec/unit/views/components/site_title_spec.rb +2 -2
- data/spec/unit/views/components/table_for_spec.rb +4 -4
- data/spec/unit/views/pages/form_spec.rb +35 -0
- data/spec/unit/views/pages/layout_spec.rb +1 -1
- data/spec/unit/views/tabbed_navigation_spec.rb +10 -10
- data/tasks/parallel_tests.rake +1 -1
- data/tasks/test.rake +4 -1
- metadata +117 -106
- data/app/assets/stylesheets/active_admin/pages/_dashboard.scss +0 -5
- data/lib/active_admin/comments/views/active_admin_comment.rb +0 -0
- data/lib/active_admin/dashboards.rb +0 -68
- data/lib/active_admin/dashboards/dashboard_controller.rb +0 -50
- data/lib/active_admin/dashboards/section.rb +0 -34
- data/lib/active_admin/locales/bg.yml +0 -77
- data/lib/generators/active_admin/install/templates/migrations/1_create_admin_notes.rb +0 -17
- data/lib/generators/active_admin/install/templates/migrations/2_move_admin_notes_to_comments.rb +0 -26
- data/spec/unit/base_controller_spec.rb +0 -6
- data/spec/unit/dashboard_controller_spec.rb +0 -76
- data/spec/unit/dashboard_section_spec.rb +0 -56
- data/spec/unit/dashboards_spec.rb +0 -59
- data/spec/unit/display_name_spec.rb +0 -29
data/features/dashboard.feature
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
Feature: Dashboard
|
2
2
|
|
3
|
-
@dashboard
|
4
3
|
Scenario: With default configuration
|
5
4
|
Given a configuration of:
|
6
5
|
"""
|
@@ -15,53 +14,3 @@ Feature: Dashboard
|
|
15
14
|
Then I should see the Active Admin layout
|
16
15
|
And I should not see the default welcome message
|
17
16
|
And I should see "Hello world from the dashboard page"
|
18
|
-
|
19
|
-
@dashboard
|
20
|
-
Scenario: DEPRECATED - With default configuration
|
21
|
-
Given a configuration of:
|
22
|
-
"""
|
23
|
-
ActiveAdmin::Dashboards.build do
|
24
|
-
end
|
25
|
-
"""
|
26
|
-
Given I am logged in
|
27
|
-
When I go to the dashboard
|
28
|
-
Then I should see the Active Admin layout
|
29
|
-
And I should see the default welcome message
|
30
|
-
|
31
|
-
@dashboard
|
32
|
-
Scenario: DEPRECATED - Displaying a dashboard widget
|
33
|
-
Given a configuration of:
|
34
|
-
"""
|
35
|
-
ActiveAdmin::Dashboards.build do
|
36
|
-
section 'Hello World' do
|
37
|
-
para "Hello world from the content"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
"""
|
41
|
-
Given I am logged in
|
42
|
-
When I go to the dashboard
|
43
|
-
Then I should see the Active Admin layout
|
44
|
-
And I should not see the default welcome message
|
45
|
-
And I should see a dashboard widget "Hello World"
|
46
|
-
And I should see "Hello world from the content"
|
47
|
-
|
48
|
-
@dashboard
|
49
|
-
Scenario: DEPRECATED - Displaying a dashboard widget using the ':if' option
|
50
|
-
Given a configuration of:
|
51
|
-
"""
|
52
|
-
ActiveAdmin::Dashboards.build do
|
53
|
-
section 'Hello World', :if => proc{ current_admin_user } do
|
54
|
-
"Hello world from the content"
|
55
|
-
end
|
56
|
-
|
57
|
-
section 'Hidden by If', :if => proc{ false } do
|
58
|
-
"Hello world from the content"
|
59
|
-
end
|
60
|
-
end
|
61
|
-
"""
|
62
|
-
Given I am logged in
|
63
|
-
When I go to the dashboard
|
64
|
-
Then I should see the Active Admin layout
|
65
|
-
And I should not see the default welcome message
|
66
|
-
And I should see a dashboard widget "Hello World"
|
67
|
-
And I should not see a dashboard widget "Hidden by If"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: Favicon
|
2
|
+
|
3
|
+
Configuring a Favicon file
|
4
|
+
|
5
|
+
Background:
|
6
|
+
Given a configuration of:
|
7
|
+
"""
|
8
|
+
ActiveAdmin.register Post
|
9
|
+
ActiveAdmin.application.favicon = "a/favicon.ico"
|
10
|
+
"""
|
11
|
+
|
12
|
+
Scenario: Logged out views show Favicon
|
13
|
+
Given I am logged out
|
14
|
+
When I am on the login page
|
15
|
+
Then I should see the favicon "a/favicon.ico"
|
16
|
+
|
17
|
+
Scenario: Logged in views show Favicon
|
18
|
+
Given I am logged in
|
19
|
+
When I am on the dashboard
|
20
|
+
Then I should see the favicon "a/favicon.ico"
|
@@ -51,14 +51,14 @@ Feature: Batch Actions
|
|
51
51
|
"""
|
52
52
|
ActiveAdmin.register Post do
|
53
53
|
batch_action(:flag) do
|
54
|
-
redirect_to collection_path, :notice => "Successfully flagged 10 posts"
|
54
|
+
redirect_to collection_path, :notice => "Successfully flagged 10 posts"
|
55
55
|
end
|
56
56
|
end
|
57
57
|
"""
|
58
58
|
When I check the 1st record
|
59
59
|
Given I submit the batch action form with "flag"
|
60
60
|
Then I should see a flash with "Successfully flagged 10 posts"
|
61
|
-
|
61
|
+
|
62
62
|
Scenario: Disabling batch actions for a resource
|
63
63
|
Given 10 posts exist
|
64
64
|
And an index configuration of:
|
@@ -67,9 +67,9 @@ Feature: Batch Actions
|
|
67
67
|
config.batch_actions = false
|
68
68
|
end
|
69
69
|
"""
|
70
|
-
Then I should not see the batch
|
70
|
+
Then I should not see the batch action selector
|
71
71
|
And I should not see checkboxes in the table
|
72
|
-
|
72
|
+
|
73
73
|
Scenario: Disabling the default destroy batch action
|
74
74
|
Given 10 posts exist
|
75
75
|
And an index configuration of:
|
@@ -79,9 +79,9 @@ Feature: Batch Actions
|
|
79
79
|
batch_action(:flag) {}
|
80
80
|
end
|
81
81
|
"""
|
82
|
-
Then I should see the batch action "Flag Selected"
|
83
|
-
And I should not see the batch action "Delete Selected"
|
84
|
-
|
82
|
+
Then I should see the batch action :flag "Flag Selected"
|
83
|
+
And I should not see the batch action :destroy "Delete Selected"
|
84
|
+
|
85
85
|
Scenario: Optional display of batch actions
|
86
86
|
Given 10 posts exist
|
87
87
|
And an index configuration of:
|
@@ -91,9 +91,9 @@ Feature: Batch Actions
|
|
91
91
|
batch_action(:unflag, :if => proc { false }) {}
|
92
92
|
end
|
93
93
|
"""
|
94
|
-
Then I should see the batch action "Flag Selected"
|
95
|
-
And I should not see the batch action "Unflag Selected"
|
96
|
-
|
94
|
+
Then I should see the batch action :flag "Flag Selected"
|
95
|
+
And I should not see the batch action :unflag "Unflag Selected"
|
96
|
+
|
97
97
|
Scenario: Sort order priority
|
98
98
|
Given 10 posts exist
|
99
99
|
And an index configuration of:
|
@@ -108,7 +108,7 @@ Feature: Batch Actions
|
|
108
108
|
And the 3rd batch action should be "Test Selected"
|
109
109
|
And the 2nd batch action should be "Flag Selected"
|
110
110
|
And the 1st batch action should be "Unflag Selected"
|
111
|
-
|
111
|
+
|
112
112
|
Scenario: Complex naming
|
113
113
|
Given 10 posts exist
|
114
114
|
And an index configuration of:
|
@@ -120,3 +120,4 @@ Feature: Batch Actions
|
|
120
120
|
"""
|
121
121
|
Then I should see the batch action :very_complex_and_time_consuming "Very Complex and Time Consuming Selected"
|
122
122
|
And I should see the batch action :passing_a_symbol "Passing A Symbol Selected"
|
123
|
+
|
@@ -17,7 +17,7 @@ Feature: Index Filtering
|
|
17
17
|
| Created at | date range |
|
18
18
|
| Updated at | date range |
|
19
19
|
|
20
|
-
When I fill in "
|
20
|
+
When I fill in "Title" with "Hello World 2"
|
21
21
|
And I press "Filter"
|
22
22
|
And I should see 1 posts in the table
|
23
23
|
And I should see "Hello World 2" within ".index_table"
|
@@ -31,7 +31,7 @@ Feature: Index Filtering
|
|
31
31
|
When I am on the index page for posts
|
32
32
|
Then I should see "Displaying all 3 Posts"
|
33
33
|
|
34
|
-
When I fill in "
|
34
|
+
When I fill in "Title" with "THIS IS NOT AN EXISTING TITLE!!"
|
35
35
|
And I press "Filter"
|
36
36
|
Then I should not see ".index_table"
|
37
37
|
And I should not see a sortable table header
|
@@ -49,7 +49,7 @@ Feature: Index Filtering
|
|
49
49
|
When I follow "2"
|
50
50
|
Then I should see "Displaying Posts 6 - 9 of 9 in total"
|
51
51
|
|
52
|
-
When I fill in "
|
52
|
+
When I fill in "Title" with "Hello World 2"
|
53
53
|
And I press "Filter"
|
54
54
|
And I should see 1 posts in the table
|
55
55
|
And I should see "Hello World 2" within ".index_table"
|
@@ -66,7 +66,7 @@ Feature: Index Filtering
|
|
66
66
|
When I press "Filter"
|
67
67
|
Then I should see 2 posts in the table
|
68
68
|
And I should see "Hello World" within ".index_table"
|
69
|
-
And the "
|
69
|
+
And the "Jane Doe" checkbox should not be checked
|
70
70
|
|
71
71
|
Scenario: Checkboxes - Filtering posts written by Jane Doe
|
72
72
|
Given 1 post exists
|
@@ -77,11 +77,11 @@ Feature: Index Filtering
|
|
77
77
|
filter :author, :as => :check_boxes
|
78
78
|
end
|
79
79
|
"""
|
80
|
-
When I check "
|
80
|
+
When I check "Jane Doe"
|
81
81
|
And I press "Filter"
|
82
82
|
Then I should see 1 posts in the table
|
83
83
|
And I should see "Hello World" within ".index_table"
|
84
|
-
And the "
|
84
|
+
And the "Jane Doe" checkbox should be checked
|
85
85
|
|
86
86
|
Scenario: Disabling filters
|
87
87
|
Given an index configuration of:
|
@@ -48,7 +48,7 @@ Feature: Format as CSV
|
|
48
48
|
Given a configuration of:
|
49
49
|
"""
|
50
50
|
ActiveAdmin.register Post do
|
51
|
-
csv :
|
51
|
+
csv :col_sep => ';' do
|
52
52
|
column :title
|
53
53
|
column :body
|
54
54
|
end
|
@@ -65,7 +65,7 @@ Feature: Format as CSV
|
|
65
65
|
Given a configuration of:
|
66
66
|
"""
|
67
67
|
ActiveAdmin.register Post do
|
68
|
-
csv :
|
68
|
+
csv :force_quotes => true do
|
69
69
|
column :title
|
70
70
|
column :body
|
71
71
|
end
|
@@ -82,7 +82,7 @@ Feature: Format as CSV
|
|
82
82
|
Scenario: With default CSV separator option
|
83
83
|
Given a configuration of:
|
84
84
|
"""
|
85
|
-
ActiveAdmin.application.
|
85
|
+
ActiveAdmin.application.csv_options = { :col_sep => ';' }
|
86
86
|
ActiveAdmin.register Post do
|
87
87
|
csv do
|
88
88
|
column :title
|
@@ -100,8 +100,7 @@ Feature: Format as CSV
|
|
100
100
|
Scenario: With default CSV options
|
101
101
|
Given a configuration of:
|
102
102
|
"""
|
103
|
-
ActiveAdmin.application.csv_options = {:force_quotes => true}
|
104
|
-
ActiveAdmin.application.csv_column_separator = ','
|
103
|
+
ActiveAdmin.application.csv_options = {:col_sep => ',', :force_quotes => true}
|
105
104
|
ActiveAdmin.register Post do
|
106
105
|
csv do
|
107
106
|
column :title
|
@@ -36,7 +36,7 @@ Feature: Index as Blog
|
|
36
36
|
"""
|
37
37
|
ActiveAdmin.register Post do
|
38
38
|
index :as => :blog do
|
39
|
-
title do |post|
|
39
|
+
title do |post|
|
40
40
|
post.title + " From Block"
|
41
41
|
end
|
42
42
|
body do |post|
|
@@ -48,3 +48,22 @@ Feature: Index as Blog
|
|
48
48
|
Then I should see "Hello World From Block" within "h3"
|
49
49
|
And I should see a link to "Hello World From Block"
|
50
50
|
And I should see "My great post body From Block" within ".post"
|
51
|
+
|
52
|
+
Scenario: Viewing a blog with a resource as a block configuration should render Abre components
|
53
|
+
Given a post with the title "Hello World" and body "My great post body" exists
|
54
|
+
And an index configuration of:
|
55
|
+
"""
|
56
|
+
ActiveAdmin.register Post do
|
57
|
+
index :as => :blog do
|
58
|
+
title do |post|
|
59
|
+
span(:class => :title_span) { post.title + " From Block " }
|
60
|
+
end
|
61
|
+
body do |post|
|
62
|
+
span(:class => :body_span) { post.body + " From Block" }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
"""
|
67
|
+
Then I should see "Hello World From Block" within "span.title_span"
|
68
|
+
And I should see a link to "Hello World From Block"
|
69
|
+
And I should see "My great post body From Block" within ".post span.body_span"
|
@@ -187,7 +187,7 @@ Feature: Index as Table
|
|
187
187
|
Then I should see the "index_table_posts" table:
|
188
188
|
| Id | Title | Title Length |
|
189
189
|
| 2 | Bye bye world | 13 |
|
190
|
-
| 1 | Hello World | 11 |
|
190
|
+
| 1 | Hello World | 11 |
|
191
191
|
When I follow "Title Length"
|
192
192
|
Then I should see the "index_table_posts" table:
|
193
193
|
| Id | Title | Title Length |
|
@@ -28,7 +28,7 @@ Feature: Index Blank Slate
|
|
28
28
|
"""
|
29
29
|
And I should see "There are no Posts yet."
|
30
30
|
And I should not see "Create one"
|
31
|
-
|
31
|
+
|
32
32
|
Scenario: Viewing a index using a grid with no resources
|
33
33
|
Given an index configuration of:
|
34
34
|
"""
|
@@ -39,7 +39,7 @@ Feature: Index Blank Slate
|
|
39
39
|
end
|
40
40
|
"""
|
41
41
|
And I should see "There are no Posts yet. Create one"
|
42
|
-
|
42
|
+
|
43
43
|
Scenario: Viewing a index using blocks with no resources
|
44
44
|
Given an index configuration of:
|
45
45
|
"""
|
@@ -50,7 +50,7 @@ Feature: Index Blank Slate
|
|
50
50
|
end
|
51
51
|
"""
|
52
52
|
And I should see "There are no Posts yet. Create one"
|
53
|
-
|
53
|
+
|
54
54
|
Scenario: Viewing a blog with no resources
|
55
55
|
Given an index configuration of:
|
56
56
|
"""
|
@@ -34,11 +34,8 @@ Feature: Index Parameters
|
|
34
34
|
Scenario: Viewing index when download_links disabled only in one namespace
|
35
35
|
Given a configuration of:
|
36
36
|
"""
|
37
|
-
ActiveAdmin.
|
38
|
-
|
39
|
-
namespace.download_links = false
|
40
|
-
end
|
41
|
-
end
|
37
|
+
ActiveAdmin.application.namespace(:superadmin).download_links = false
|
38
|
+
ActiveAdmin.register AdminUser, :namespace => :superadmin
|
42
39
|
"""
|
43
40
|
Given an index configuration of:
|
44
41
|
"""
|
@@ -60,11 +57,8 @@ Feature: Index Parameters
|
|
60
57
|
Scenario: Viewing index when download_links enabled only for a resource
|
61
58
|
Given a configuration of:
|
62
59
|
"""
|
63
|
-
ActiveAdmin.
|
64
|
-
|
65
|
-
namespace.download_links = false
|
66
|
-
end
|
67
|
-
end
|
60
|
+
ActiveAdmin.application.namespace(:superadmin).download_links = false
|
61
|
+
ActiveAdmin.register AdminUser, :namespace => :superadmin
|
68
62
|
"""
|
69
63
|
Given an index configuration of:
|
70
64
|
"""
|
@@ -30,3 +30,27 @@ Feature: Index Scope To
|
|
30
30
|
|
31
31
|
When I follow "Published"
|
32
32
|
Then I should see 1 posts in the table
|
33
|
+
|
34
|
+
Scenario: Viewing the index with conditional scope :if
|
35
|
+
Given an index configuration of:
|
36
|
+
"""
|
37
|
+
ActiveAdmin.register Post do
|
38
|
+
scope_to :if => proc{ false } do
|
39
|
+
User.find_by_first_name_and_last_name("John", "Doe")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
"""
|
43
|
+
When I am on the index page for posts
|
44
|
+
Then I should see 12 posts in the table
|
45
|
+
|
46
|
+
Scenario: Viewing the index with conditional scope :unless
|
47
|
+
Given an index configuration of:
|
48
|
+
"""
|
49
|
+
ActiveAdmin.register Post do
|
50
|
+
scope_to :unless => proc{ true } do
|
51
|
+
User.find_by_first_name_and_last_name("John", "Doe")
|
52
|
+
end
|
53
|
+
end
|
54
|
+
"""
|
55
|
+
When I am on the index page for posts
|
56
|
+
Then I should see 12 posts in the table
|
@@ -26,6 +26,18 @@ Feature: Index Scoping
|
|
26
26
|
And I should see the scope "All" with the count 3
|
27
27
|
And I should see 3 posts in the table
|
28
28
|
|
29
|
+
Scenario: Viewing resources with one scope that is set as not default
|
30
|
+
Given 3 posts exist
|
31
|
+
And an index configuration of:
|
32
|
+
"""
|
33
|
+
ActiveAdmin.register Post do
|
34
|
+
scope :all, :default => proc{ false }
|
35
|
+
end
|
36
|
+
"""
|
37
|
+
Then I should see the scope "All" not selected
|
38
|
+
And I should see the scope "All" with the count 3
|
39
|
+
And I should see 3 posts in the table
|
40
|
+
|
29
41
|
Scenario: Viewing resources with a scope and no results
|
30
42
|
Given 3 posts exist
|
31
43
|
And an index configuration of:
|
@@ -35,7 +47,7 @@ Feature: Index Scoping
|
|
35
47
|
filter :title
|
36
48
|
end
|
37
49
|
"""
|
38
|
-
When I fill in "
|
50
|
+
When I fill in "Title" with "Non Existing Post"
|
39
51
|
And I press "Filter"
|
40
52
|
Then I should see the scope "All" selected
|
41
53
|
|
@@ -110,7 +122,7 @@ Feature: Index Scoping
|
|
110
122
|
And I should see the scope "Published" with the count 3
|
111
123
|
And I should see 3 posts in the table
|
112
124
|
|
113
|
-
When I select "
|
125
|
+
When I select "Daft Punk" from "Author"
|
114
126
|
And I press "Filter"
|
115
127
|
|
116
128
|
Then I should see the scope "Published" selected
|
@@ -165,7 +177,7 @@ Feature: Index Scoping
|
|
165
177
|
Then I should see the scope "Tomorrow" selected
|
166
178
|
And I should see the scope "Today" not selected
|
167
179
|
And I should see a link to "Today"
|
168
|
-
|
180
|
+
|
169
181
|
Scenario: Viewing resources with scopes when scoping to user
|
170
182
|
Given 2 posts written by "Daft Punk" exist
|
171
183
|
And a post with the title "Monkey Wrench" written by "Foo Fighters" exists
|
@@ -187,7 +199,7 @@ Feature: Index Scoping
|
|
187
199
|
"""
|
188
200
|
Then I should see the scope "All" selected
|
189
201
|
And I should see the scope "All" with the count 2
|
190
|
-
When I fill in "
|
202
|
+
When I fill in "Title" with "Monkey"
|
191
203
|
And I press "Filter"
|
192
204
|
Then I should see the scope "All" selected
|
193
205
|
And I should see the scope "All" with the count 1
|
@@ -230,7 +242,7 @@ Feature: Index Scoping
|
|
230
242
|
And I should see the scope "Published" with the count 1
|
231
243
|
And I should see 1 posts in the table
|
232
244
|
|
233
|
-
When I select "
|
245
|
+
When I select "Daft Punk" from "Author"
|
234
246
|
And I press "Filter"
|
235
247
|
|
236
248
|
Then I should see the scope "Published" selected
|
@@ -42,3 +42,18 @@ Feature: Index Pagination
|
|
42
42
|
Given 31 posts exist
|
43
43
|
When I am on the index page for posts
|
44
44
|
Then I should not see pagination
|
45
|
+
|
46
|
+
Scenario: Viewing index with pagination_total set to false
|
47
|
+
Given an index configuration of:
|
48
|
+
"""
|
49
|
+
ActiveAdmin.register Post do
|
50
|
+
index :pagination_total => false do
|
51
|
+
end
|
52
|
+
end
|
53
|
+
"""
|
54
|
+
Given 100 posts exist
|
55
|
+
When I am on the index page for posts
|
56
|
+
Then I should see pagination with 2 pages
|
57
|
+
Then I should see "Displaying Posts 1 - 30"
|
58
|
+
And I should not see "Displaying Posts 1 - 30 of 100 in total"
|
59
|
+
|