underworld 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE +339 -0
- data/Rakefile +48 -0
- data/app/assets/fonts/DroidNaskh-Bold.ttf +0 -0
- data/app/assets/fonts/DroidNaskh-Regular.ttf +0 -0
- data/app/assets/fonts/OpenSans-Bold.ttf +0 -0
- data/app/assets/fonts/OpenSans-BoldItalic.ttf +0 -0
- data/app/assets/fonts/OpenSans-ExtraBold.ttf +0 -0
- data/app/assets/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- data/app/assets/fonts/OpenSans-Italic.ttf +0 -0
- data/app/assets/fonts/OpenSans-Light.ttf +0 -0
- data/app/assets/fonts/OpenSans-LightItalic.ttf +0 -0
- data/app/assets/fonts/OpenSans-Regular.ttf +0 -0
- data/app/assets/fonts/OpenSans-Semibold.ttf +0 -0
- data/app/assets/fonts/OpenSans-SemiboldItalic.ttf +0 -0
- data/app/assets/images/underworld/select2-spinner.gif +0 -0
- data/app/assets/images/underworld/select2.png +0 -0
- data/app/assets/images/underworld/select2x2.png +0 -0
- data/app/assets/javascripts/underworld/application.js +16 -0
- data/app/assets/javascripts/underworld/dashboard/application.js.erb +30 -0
- data/app/assets/javascripts/underworld/dashboard/functions.js.erb +50 -0
- data/app/assets/javascripts/underworld/dashboard/init.js.coffee +33 -0
- data/app/assets/javascripts/underworld/dashboard/lib/actions.js +7 -0
- data/app/assets/javascripts/underworld/dashboard/lib/amd.js.coffee.erb +0 -0
- data/app/assets/javascripts/underworld/dashboard/lib/flash_message.js +71 -0
- data/app/assets/javascripts/underworld/dashboard/lib/locale.js +14 -0
- data/app/assets/javascripts/underworld/dashboard/lib/misc.js +5 -0
- data/app/assets/javascripts/underworld/dashboard/lib/string.js +3 -0
- data/app/assets/javascripts/underworld/dashboard/lib/ujs_patches.js.coffee +28 -0
- data/app/assets/javascripts/underworld/dashboard/manifest.js +5 -0
- data/app/assets/javascripts/underworld/dashboard/variables.js.erb +6 -0
- data/app/assets/javascripts/underworld/groups.js +2 -0
- data/app/assets/javascripts/underworld/home.js +2 -0
- data/app/assets/javascripts/underworld/i18n.js +13 -0
- data/app/assets/javascripts/underworld/simple.js +20 -0
- data/app/assets/javascripts/underworld/users.js +2 -0
- data/app/assets/stylesheets/underworld/dashboard/loadindicator.scss +17 -0
- data/app/assets/stylesheets/underworld/dashboard/ltr/application.css +38 -0
- data/app/assets/stylesheets/underworld/dashboard/ltr/base.css.scss +0 -0
- data/app/assets/stylesheets/underworld/dashboard/rtl/application.css +11 -0
- data/app/assets/stylesheets/underworld/dashboard/rtl/base.css.scss +0 -0
- data/app/assets/stylesheets/underworld/dashboard/share.scss +62 -0
- data/app/assets/stylesheets/underworld/dashboard/variables.scss +9 -0
- data/app/assets/stylesheets/underworld/ltr/application.css +0 -0
- data/app/assets/stylesheets/underworld/rtl/application.css +0 -0
- data/app/assets/stylesheets/underworld/simple/ltr/application.css +2 -0
- data/app/assets/stylesheets/underworld/simple/rtl/application.css +2 -0
- data/app/assets/stylesheets/underworld/simple/rtl/rtl.scss +16 -0
- data/app/assets/stylesheets/underworld/simple/share.scss +11 -0
- data/app/controllers/underworld/api_controller.rb +133 -0
- data/app/controllers/underworld/application_controller.rb +16 -0
- data/app/controllers/underworld/assets_controller.rb +6 -0
- data/app/controllers/underworld/dashboard/application_controller.rb +43 -0
- data/app/controllers/underworld/dashboard/groups_controller.rb +85 -0
- data/app/controllers/underworld/dashboard/profile_controller.rb +49 -0
- data/app/controllers/underworld/dashboard/user_messages_controller.rb +27 -0
- data/app/controllers/underworld/dashboard/users_controller.rb +116 -0
- data/app/controllers/underworld/dashboard_controller.rb +16 -0
- data/app/controllers/underworld/omniauth/callbacks_controller.rb +24 -0
- data/app/helpers/underworld/application_helper.rb +4 -0
- data/app/helpers/underworld/dashboard_helper.rb +107 -0
- data/app/helpers/underworld/groups_helper.rb +4 -0
- data/app/helpers/underworld/home_helper.rb +4 -0
- data/app/helpers/underworld/users_helper.rb +8 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/underworld/concerns/assignment.rb +16 -0
- data/app/models/underworld/concerns/user/auth_definitions.rb +87 -0
- data/app/models/underworld/concerns/user/gravatar.rb +11 -0
- data/app/models/underworld/concerns/user/mongoid_fields.rb +81 -0
- data/app/models/underworld/concerns/user/permission.rb +47 -0
- data/app/models/underworld/concerns/user/user_roles.rb +24 -0
- data/app/models/underworld/group.rb +57 -0
- data/app/models/underworld/permission.rb +43 -0
- data/app/models/underworld/user.rb +81 -0
- data/app/models/underworld/user_message.rb +6 -0
- data/app/policies/underworld/admin_only_policy.rb +66 -0
- data/app/policies/underworld/application_policy.rb +55 -0
- data/app/policies/underworld/group_policy.rb +8 -0
- data/app/policies/underworld/user_message_policy.rb +9 -0
- data/app/policies/underworld/user_policy.rb +9 -0
- data/app/views/angular/auth/groups/details.html +2 -0
- data/app/views/angular/auth/groups/index.html +2 -0
- data/app/views/angular/auth/groups/new.html +2 -0
- data/app/views/angular/auth/index.html +30 -0
- data/app/views/angular/auth/profile/edit.html +54 -0
- data/app/views/angular/auth/users/details.html +28 -0
- data/app/views/angular/auth/users/index.html +6 -0
- data/app/views/angular/auth/users/new.html +57 -0
- data/app/views/angular/conversations/details.html +19 -0
- data/app/views/angular/conversations/index.html +13 -0
- data/app/views/angular/conversations/new.html +39 -0
- data/app/views/angular/conversations/show.html +6 -0
- data/app/views/angular/conversations/show_details.html +15 -0
- data/app/views/angular/fields/boolean/boolean.html +4 -0
- data/app/views/angular/fields/control-combo/control-list.html +19 -0
- data/app/views/angular/fields/datetime/datetime.html +10 -0
- data/app/views/angular/fields/datetime/time.html +25 -0
- data/app/views/angular/fields/file/file.html.slim +0 -0
- data/app/views/angular/fields/float/float.html +4 -0
- data/app/views/angular/fields/image/image.html +1 -0
- data/app/views/angular/fields/integer/integer.html +4 -0
- data/app/views/angular/fields/relation/relation.html +44 -0
- data/app/views/angular/fields/string/string.html +22 -0
- data/app/views/angular/fields/tag/tag.html +1 -0
- data/app/views/angular/fields/text/text.html +4 -0
- data/app/views/angular/filter/index.html +15 -0
- data/app/views/angular/index.html +3 -0
- data/app/views/angular/locale/fa.po +25 -0
- data/app/views/angular/locale/templates.pot +24 -0
- data/app/views/angular/logs/index.html +6 -0
- data/app/views/angular/modules.html +0 -0
- data/app/views/angular/nav.html.erb +39 -0
- data/app/views/angular/underworld/views/generic_add_view.html.slim +5 -0
- data/app/views/devise/registrations/edit.html.erb +29 -0
- data/app/views/devise/registrations/new.html.erb +38 -0
- data/app/views/devise/sessions/new.html.erb +37 -0
- data/app/views/devise/shared/_links.erb +19 -0
- data/app/views/devise/shared/_omni_link.erb +33 -0
- data/app/views/kaminari/_first_page.html.slim +3 -0
- data/app/views/kaminari/_gap.html.slim +2 -0
- data/app/views/kaminari/_last_page.html.slim +3 -0
- data/app/views/kaminari/_next_page.html.slim +3 -0
- data/app/views/kaminari/_page.html.slim +3 -0
- data/app/views/kaminari/_paginator.html.slim +13 -0
- data/app/views/kaminari/_prev_page.html.slim +3 -0
- data/app/views/layouts/underworld/application.html.erb +79 -0
- data/app/views/layouts/underworld/dashboard.html.erb +52 -0
- data/app/views/layouts/underworld/simple.html.erb +27 -0
- data/app/views/underworld/api/v1/conversations/create.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/destroy.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/index.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/reply.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/conversations/show.json.jbuilder +14 -0
- data/app/views/underworld/api/v1/conversations/trash.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/groups/create.json.jbuilder +4 -0
- data/app/views/underworld/api/v1/groups/destroy.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/destroy.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/groups/edit.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/index.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/index.json.jbuilder +6 -0
- data/app/views/underworld/api/v1/groups/new.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/show.html.erb +2 -0
- data/app/views/underworld/api/v1/groups/show.json.jbuilder +5 -0
- data/app/views/underworld/api/v1/groups/update.json.jbuilder +4 -0
- data/app/views/underworld/api/v1/logs/index.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/permissions/index.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/permissions/user_permissions.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/users/create.html.erb +2 -0
- data/app/views/underworld/api/v1/users/create.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/users/destroy.json.jbuilder +1 -0
- data/app/views/underworld/api/v1/users/distroy.html.erb +2 -0
- data/app/views/underworld/api/v1/users/edit.html.erb +2 -0
- data/app/views/underworld/api/v1/users/index.html.erb +2 -0
- data/app/views/underworld/api/v1/users/index.json.jbuilder +4 -0
- data/app/views/underworld/api/v1/users/show.html.erb +2 -0
- data/app/views/underworld/api/v1/users/show.json.jbuilder +2 -0
- data/app/views/underworld/api/v1/users/update.json.jbuilder +1 -0
- data/app/views/underworld/dashboard/groups/_form.html.slim +68 -0
- data/app/views/underworld/dashboard/groups/create.js.erb +3 -0
- data/app/views/underworld/dashboard/groups/edit.html.slim +3 -0
- data/app/views/underworld/dashboard/groups/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/groups/index.html.slim +47 -0
- data/app/views/underworld/dashboard/groups/new.html.slim +2 -0
- data/app/views/underworld/dashboard/groups/update.js.erb +3 -0
- data/app/views/underworld/dashboard/index.html.erb +0 -0
- data/app/views/underworld/dashboard/login_required_page.html.erb +5 -0
- data/app/views/underworld/dashboard/not_found.html.slim +9 -0
- data/app/views/underworld/dashboard/not_found.js.erb +1 -0
- data/app/views/underworld/dashboard/profile/_form.html.erb +33 -0
- data/app/views/underworld/dashboard/profile/_profile_form.html.erb +33 -0
- data/app/views/underworld/dashboard/profile/create.js.erb +3 -0
- data/app/views/underworld/dashboard/profile/edit.html.erb +2 -0
- data/app/views/underworld/dashboard/profile/edit_password.html.erb +2 -0
- data/app/views/underworld/dashboard/profile/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/resource/_form.html.slim +33 -0
- data/app/views/underworld/dashboard/resource/_input.html.slim +3 -0
- data/app/views/underworld/dashboard/resource/create.js.erb +3 -0
- data/app/views/underworld/dashboard/resource/destroy.js.erb +2 -0
- data/app/views/underworld/dashboard/resource/edit.html.slim +3 -0
- data/app/views/underworld/dashboard/resource/index.html.slim +60 -0
- data/app/views/underworld/dashboard/resource/new.html.slim +2 -0
- data/app/views/underworld/dashboard/resource/show.html.slim +22 -0
- data/app/views/underworld/dashboard/resource/update.js.erb +3 -0
- data/app/views/underworld/dashboard/shared/_content_header.html.slim +15 -0
- data/app/views/underworld/dashboard/shared/_control_sidebar.html.slim +50 -0
- data/app/views/underworld/dashboard/shared/_footer.html.slim +7 -0
- data/app/views/underworld/dashboard/shared/_header.html.erb +98 -0
- data/app/views/underworld/dashboard/shared/_sidebar.html.erb +69 -0
- data/app/views/underworld/dashboard/shared/_toolbar.html.slim +0 -0
- data/app/views/underworld/dashboard/shared/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/user_messages/_form.html.slim +0 -0
- data/app/views/underworld/dashboard/user_messages/create.js.erb +0 -0
- data/app/views/underworld/dashboard/user_messages/destroy.js.erb +0 -0
- data/app/views/underworld/dashboard/user_messages/new.html.slim +72 -0
- data/app/views/underworld/dashboard/users/_form.html.slim +73 -0
- data/app/views/underworld/dashboard/users/_password_form.html.slim +37 -0
- data/app/views/underworld/dashboard/users/create.js.erb +3 -0
- data/app/views/underworld/dashboard/users/destroy.js.erb +2 -0
- data/app/views/underworld/dashboard/users/edit.html.slim +3 -0
- data/app/views/underworld/dashboard/users/edit_password.html.slim +1 -0
- data/app/views/underworld/dashboard/users/errors.js.erb +3 -0
- data/app/views/underworld/dashboard/users/index.html.slim +66 -0
- data/app/views/underworld/dashboard/users/new.html.slim +2 -0
- data/app/views/underworld/dashboard/users/show.html.slim +6 -0
- data/app/views/underworld/dashboard/users/update.js.erb +3 -0
- data/app/views/underworld/dashboard/users/update_password.js.erb +3 -0
- data/app/views/underworld/relations/_belongs_to.json.jbuilder +11 -0
- data/config/initializers/devise.rb +24 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/devise.fa.yml +58 -0
- data/config/locales/underworld.en.yml +96 -0
- data/config/locales/underworld.fa.yml +108 -0
- data/config/routes.rb +43 -0
- data/config/spring.rb +1 -0
- data/db/migrate/20131013091000_devise_create_underworld_users.rb +65 -0
- data/db/migrate/20131020124701_create_underworld_groups.rb +15 -0
- data/db/migrate/20131021170923_create_underworld_permissions.rb +15 -0
- data/db/migrate/20131123120422_add_permissions_groups_table.rb +16 -0
- data/db/migrate/20140613120923_add_users_groups_table.rb +13 -0
- data/db/migrate/20151122115129_add_uniqueness_index_to_users_groups.rb +11 -0
- data/db/migrate/20160310105736_create_underworld_user_messages.rb +25 -0
- data/db/seeds.rb +49 -0
- data/lib/generators/underworld/install_generator.rb +108 -0
- data/lib/generators/underworld/resource_generator.rb +70 -0
- data/lib/generators/underworld/resources_generator.rb +20 -0
- data/lib/generators/underworld/templates/README +21 -0
- data/lib/generators/underworld/templates/SPECS +13 -0
- data/lib/generators/underworld/templates/api/controller.rb.erb +60 -0
- data/lib/generators/underworld/templates/api_controller.rb +2 -0
- data/lib/generators/underworld/templates/dashboard/controller.rb.erb +2 -0
- data/lib/generators/underworld/templates/dashboard_controller.rb +18 -0
- data/lib/generators/underworld/templates/devise.rb +251 -0
- data/lib/generators/underworld/templates/features/api.feature +92 -0
- data/lib/generators/underworld/templates/features/api.step.rb +7 -0
- data/lib/generators/underworld/templates/features/step_definitions/email_steps.rb +206 -0
- data/lib/generators/underworld/templates/features/support/email_spec.rb +1 -0
- data/lib/generators/underworld/templates/features/support/env.rb +79 -0
- data/lib/generators/underworld/templates/javascripts/application.js +19 -0
- data/lib/generators/underworld/templates/policy/application_policy.rb +2 -0
- data/lib/generators/underworld/templates/policy/policy.rb.erb +2 -0
- data/lib/generators/underworld/templates/seeds.rb +1 -0
- data/lib/generators/underworld/templates/spec/factories/groups.rb +5 -0
- data/lib/generators/underworld/templates/spec/factories/users.rb +10 -0
- data/lib/generators/underworld/templates/spec/spec_helper.rb +69 -0
- data/lib/generators/underworld/templates/spec/support/devise.rb +3 -0
- data/lib/generators/underworld/templates/stylesheets/dashboard/ltr/application.css +3 -0
- data/lib/generators/underworld/templates/stylesheets/dashboard/rtl/application.css +3 -0
- data/lib/generators/underworld/templates/stylesheets/ltr/application.css +3 -0
- data/lib/generators/underworld/templates/stylesheets/rtl/application.css +3 -0
- data/lib/generators/underworld/templates/underworld.rb +12 -0
- data/lib/generators/underworld/templates/views/create.json.jbuilder.erb +3 -0
- data/lib/generators/underworld/templates/views/destroy.json.jbuilder.erb +1 -0
- data/lib/generators/underworld/templates/views/index.json.jbuilder.erb +13 -0
- data/lib/generators/underworld/templates/views/show.json.jbuilder.erb +6 -0
- data/lib/generators/underworld/templates/views/update.json.jbuilder.erb +6 -0
- data/lib/generators/underworld/views_generator.rb +57 -0
- data/lib/tasks/docs.rake +6 -0
- data/lib/tasks/sync.rake +9 -0
- data/lib/tasks/underworld_tasks.rake +38 -0
- data/lib/underworld.rb +35 -0
- data/lib/underworld/action_dispatch.rb +3 -0
- data/lib/underworld/api.rb +42 -0
- data/lib/underworld/api/groups_api.rb +41 -0
- data/lib/underworld/api/permissions_api.rb +24 -0
- data/lib/underworld/api/root.rb +15 -0
- data/lib/underworld/api/users_api.rb +20 -0
- data/lib/underworld/concerns.rb +7 -0
- data/lib/underworld/concerns/authorizable.rb +81 -0
- data/lib/underworld/configuration.rb +97 -0
- data/lib/underworld/dashboard.rb +11 -0
- data/lib/underworld/dashboard/dsl.rb +41 -0
- data/lib/underworld/dashboard/dsl/base.rb +133 -0
- data/lib/underworld/dashboard/dsl/create.rb +116 -0
- data/lib/underworld/dashboard/dsl/form_fields_properties.rb +62 -0
- data/lib/underworld/dashboard/dsl/index.rb +45 -0
- data/lib/underworld/dashboard/dsl/show.rb +6 -0
- data/lib/underworld/dashboard/dsl/update.rb +6 -0
- data/lib/underworld/dashboard/helpers/box_helpers.rb +129 -0
- data/lib/underworld/dashboard/models.rb +2 -0
- data/lib/underworld/dashboard/models/sidebar.rb +139 -0
- data/lib/underworld/dashboard/sections.rb +2 -0
- data/lib/underworld/dashboard/sections/resource.rb +229 -0
- data/lib/underworld/dashboard/sections/resource_create.rb +263 -0
- data/lib/underworld/dashboard/sections/resource_destroy.rb +27 -0
- data/lib/underworld/dashboard/sections/resource_show.rb +96 -0
- data/lib/underworld/dashboard/sections/resources_index.rb +113 -0
- data/lib/underworld/dashboard/sections/sidebar.rb +41 -0
- data/lib/underworld/discovery.rb +8 -0
- data/lib/underworld/discovery/permissions.rb +49 -0
- data/lib/underworld/engine.rb +53 -0
- data/lib/underworld/exceptions.rb +7 -0
- data/lib/underworld/extension.rb +18 -0
- data/lib/underworld/extension/base.rb +29 -0
- data/lib/underworld/fake_assets.rb +5 -0
- data/lib/underworld/i18n.rb +101 -0
- data/lib/underworld/initialize.rb +0 -0
- data/lib/underworld/liquid.rb +7 -0
- data/lib/underworld/liquid/block.rb +14 -0
- data/lib/underworld/liquid/render_tag.rb +50 -0
- data/lib/underworld/liquid/tag.rb +51 -0
- data/lib/underworld/middlewares.rb +1 -0
- data/lib/underworld/middlewares/locale.rb +29 -0
- data/lib/underworld/omniauth.rb +8 -0
- data/lib/underworld/omniauth/callbacks.rb +39 -0
- data/lib/underworld/orm.rb +30 -0
- data/lib/underworld/routes.rb +117 -0
- data/lib/underworld/version.rb +3 -0
- data/test/controllers/underworld/dashboard/resource_test.rb +118 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/javascripts/dashboard/application.js +19 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/assets/stylesheets/dashboard/ltr/application.css +3 -0
- data/test/dummy/app/assets/stylesheets/dashboard/rtl/application.css +3 -0
- data/test/dummy/app/assets/stylesheets/ltr/application.css +3 -0
- data/test/dummy/app/assets/stylesheets/rtl/application.css +3 -0
- data/test/dummy/app/controllers/api_controller.rb +2 -0
- data/test/dummy/app/controllers/application_controller.rb +6 -0
- data/test/dummy/app/controllers/dashboard/application_controller.rb +18 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/policies/application_policy.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +29 -0
- data/test/dummy/config/environments/production.rb +80 -0
- data/test/dummy/config/environments/test.rb +38 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +251 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/formstatic.rb +76 -0
- data/test/dummy/config/initializers/formtastic.rb +110 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/kaminari_config.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/underworld.rb +11 -0
- data/test/dummy/config/initializers/underworld_assets.rb +1 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +13 -0
- data/test/dummy/lib/templates/slim/scaffold/_form.html.slim +8 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fabricators/underworld/groups.rb +27 -0
- data/test/fabricators/underworld/permissions.rb +14 -0
- data/test/fabricators/underworld/users.rb +17 -0
- data/test/generators/install_generator_test.rb +84 -0
- data/test/integration/underworld/authentication_test.rb +36 -0
- data/test/integration/underworld/dashboard_test.rb +64 -0
- data/test/test_helper.rb +72 -0
- metadata +1045 -0
- metadata.gz.sig +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Commonly used email steps
|
|
2
|
+
#
|
|
3
|
+
# To add your own steps make a custom_email_steps.rb
|
|
4
|
+
# The provided methods are:
|
|
5
|
+
#
|
|
6
|
+
# last_email_address
|
|
7
|
+
# reset_mailer
|
|
8
|
+
# open_last_email
|
|
9
|
+
# visit_in_email
|
|
10
|
+
# unread_emails_for
|
|
11
|
+
# mailbox_for
|
|
12
|
+
# current_email
|
|
13
|
+
# open_email
|
|
14
|
+
# read_emails_for
|
|
15
|
+
# find_email
|
|
16
|
+
#
|
|
17
|
+
# General form for email scenarios are:
|
|
18
|
+
# - clear the email queue (done automatically by email_spec)
|
|
19
|
+
# - execute steps that sends an email
|
|
20
|
+
# - check the user received an/no/[0-9] emails
|
|
21
|
+
# - open the email
|
|
22
|
+
# - inspect the email contents
|
|
23
|
+
# - interact with the email (e.g. click links)
|
|
24
|
+
#
|
|
25
|
+
# The Cucumber steps below are setup in this order.
|
|
26
|
+
|
|
27
|
+
module EmailHelpers
|
|
28
|
+
def current_email_address
|
|
29
|
+
# Replace with your a way to find your current email. e.g @current_user.email
|
|
30
|
+
# last_email_address will return the last email address used by email spec to find an email.
|
|
31
|
+
# Note that last_email_address will be reset after each Scenario.
|
|
32
|
+
last_email_address || "example@example.com"
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
World(EmailHelpers)
|
|
37
|
+
|
|
38
|
+
#
|
|
39
|
+
# Reset the e-mail queue within a scenario.
|
|
40
|
+
# This is done automatically before each scenario.
|
|
41
|
+
#
|
|
42
|
+
|
|
43
|
+
Given /^(?:a clear email queue|no emails have been sent)$/ do
|
|
44
|
+
reset_mailer
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
#
|
|
48
|
+
# Check how many emails have been sent/received
|
|
49
|
+
#
|
|
50
|
+
|
|
51
|
+
Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails?$/ do |address, amount|
|
|
52
|
+
unread_emails_for(address).size.should == parse_email_count(amount)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
Then /^(?:I|they|"([^"]*?)") should have (an|no|\d+) emails?$/ do |address, amount|
|
|
56
|
+
mailbox_for(address).size.should == parse_email_count(amount)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails? with subject "([^"]*?)"$/ do |address, amount, subject|
|
|
60
|
+
unread_emails_for(address).select { |m| m.subject =~ Regexp.new(Regexp.escape(subject)) }.size.should == parse_email_count(amount)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails? with subject \/([^"]*?)\/$/ do |address, amount, subject|
|
|
64
|
+
unread_emails_for(address).select { |m| m.subject =~ Regexp.new(subject) }.size.should == parse_email_count(amount)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
Then /^(?:I|they|"([^"]*?)") should receive an email with the following body:$/ do |address, expected_body|
|
|
68
|
+
open_email(address, :with_text => expected_body)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
#
|
|
72
|
+
# Accessing emails
|
|
73
|
+
#
|
|
74
|
+
|
|
75
|
+
# Opens the most recently received email
|
|
76
|
+
When /^(?:I|they|"([^"]*?)") opens? the email$/ do |address|
|
|
77
|
+
open_email(address)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
When /^(?:I|they|"([^"]*?)") opens? the email with subject "([^"]*?)"$/ do |address, subject|
|
|
81
|
+
open_email(address, :with_subject => subject)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
When /^(?:I|they|"([^"]*?)") opens? the email with subject \/([^"]*?)\/$/ do |address, subject|
|
|
85
|
+
open_email(address, :with_subject => Regexp.new(subject))
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
When /^(?:I|they|"([^"]*?)") opens? the email with text "([^"]*?)"$/ do |address, text|
|
|
89
|
+
open_email(address, :with_text => text)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
When /^(?:I|they|"([^"]*?)") opens? the email with text \/([^"]*?)\/$/ do |address, text|
|
|
93
|
+
open_email(address, :with_text => Regexp.new(text))
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
#
|
|
97
|
+
# Inspect the Email Contents
|
|
98
|
+
#
|
|
99
|
+
|
|
100
|
+
Then /^(?:I|they) should see "([^"]*?)" in the email subject$/ do |text|
|
|
101
|
+
current_email.should have_subject(text)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
Then /^(?:I|they) should see \/([^"]*?)\/ in the email subject$/ do |text|
|
|
105
|
+
current_email.should have_subject(Regexp.new(text))
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
Then /^(?:I|they) should see "([^"]*?)" in the email body$/ do |text|
|
|
109
|
+
current_email.default_part_body.to_s.should include(text)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
Then /^(?:I|they) should see \/([^"]*?)\/ in the email body$/ do |text|
|
|
113
|
+
current_email.default_part_body.to_s.should =~ Regexp.new(text)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
Then /^(?:I|they) should see the email delivered from "([^"]*?)"$/ do |text|
|
|
117
|
+
current_email.should be_delivered_from(text)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
Then /^(?:I|they) should see "([^\"]*)" in the email "([^"]*?)" header$/ do |text, name|
|
|
121
|
+
current_email.should have_header(name, text)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
Then /^(?:I|they) should see \/([^\"]*)\/ in the email "([^"]*?)" header$/ do |text, name|
|
|
125
|
+
current_email.should have_header(name, Regexp.new(text))
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
Then /^I should see it is a multi\-part email$/ do
|
|
129
|
+
current_email.should be_multipart
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
Then /^(?:I|they) should see "([^"]*?)" in the email html part body$/ do |text|
|
|
133
|
+
current_email.html_part.body.to_s.should include(text)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
Then /^(?:I|they) should see "([^"]*?)" in the email text part body$/ do |text|
|
|
137
|
+
current_email.text_part.body.to_s.should include(text)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
#
|
|
141
|
+
# Inspect the Email Attachments
|
|
142
|
+
#
|
|
143
|
+
|
|
144
|
+
Then /^(?:I|they) should see (an|no|\d+) attachments? with the email$/ do |amount|
|
|
145
|
+
current_email_attachments.size.should == parse_email_count(amount)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
Then /^there should be (an|no|\d+) attachments? named "([^"]*?)"$/ do |amount, filename|
|
|
149
|
+
current_email_attachments.select { |a| a.filename == filename }.size.should == parse_email_count(amount)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
Then /^attachment (\d+) should be named "([^"]*?)"$/ do |index, filename|
|
|
153
|
+
current_email_attachments[(index.to_i - 1)].filename.should == filename
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
Then /^there should be (an|no|\d+) attachments? of type "([^"]*?)"$/ do |amount, content_type|
|
|
157
|
+
current_email_attachments.select { |a| a.content_type.include?(content_type) }.size.should == parse_email_count(amount)
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
Then /^attachment (\d+) should be of type "([^"]*?)"$/ do |index, content_type|
|
|
161
|
+
current_email_attachments[(index.to_i - 1)].content_type.should include(content_type)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
Then /^all attachments should not be blank$/ do
|
|
165
|
+
current_email_attachments.each do |attachment|
|
|
166
|
+
attachment.read.size.should_not == 0
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
Then /^show me a list of email attachments$/ do
|
|
171
|
+
EmailSpec::EmailViewer::save_and_open_email_attachments_list(current_email)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
#
|
|
175
|
+
# Interact with Email Contents
|
|
176
|
+
#
|
|
177
|
+
|
|
178
|
+
When /^(?:I|they|"([^"]*?)") follows? "([^"]*?)" in the email$/ do |address, link|
|
|
179
|
+
visit_in_email(link, address)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
When /^(?:I|they) click the first link in the email$/ do
|
|
183
|
+
click_first_link_in_email
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
#
|
|
187
|
+
# Debugging
|
|
188
|
+
# These only work with Rails and OSx ATM since EmailViewer uses RAILS_ROOT and OSx's 'open' command.
|
|
189
|
+
# Patches accepted. ;)
|
|
190
|
+
#
|
|
191
|
+
|
|
192
|
+
Then /^save and open current email$/ do
|
|
193
|
+
EmailSpec::EmailViewer::save_and_open_email(current_email)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
Then /^save and open all text emails$/ do
|
|
197
|
+
EmailSpec::EmailViewer::save_and_open_all_text_emails
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
Then /^save and open all html emails$/ do
|
|
201
|
+
EmailSpec::EmailViewer::save_and_open_all_html_emails
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
Then /^save and open all raw emails$/ do
|
|
205
|
+
EmailSpec::EmailViewer::save_and_open_all_raw_emails
|
|
206
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'email_spec/cucumber'
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
|
5
|
+
# files.
|
|
6
|
+
|
|
7
|
+
require 'cucumber/rails'
|
|
8
|
+
require 'capybara/rails'
|
|
9
|
+
require 'capybara/cucumber'
|
|
10
|
+
require 'capybara/session'
|
|
11
|
+
require "json_spec/cucumber"
|
|
12
|
+
require "underworld/cucumber"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def last_json
|
|
16
|
+
page.source
|
|
17
|
+
end
|
|
18
|
+
# Capybara defaults to CSS3 selectors rather than XPath.
|
|
19
|
+
# If you'd prefer to use XPath, just uncomment this line and adjust any
|
|
20
|
+
# selectors in your step definitions to use the XPath syntax.
|
|
21
|
+
# Capybara.default_selector = :xpath
|
|
22
|
+
|
|
23
|
+
# By default, any exception happening in your Rails application will bubble up
|
|
24
|
+
# to Cucumber so that your scenario will fail. This is a different from how
|
|
25
|
+
# your application behaves in the production environment, where an error page will
|
|
26
|
+
# be rendered instead.
|
|
27
|
+
#
|
|
28
|
+
# Sometimes we want to override this default behaviour and allow Rails to rescue
|
|
29
|
+
# exceptions and display an error page (just like when the app is running in production).
|
|
30
|
+
# Typical scenarios where you want to do this is when you test your error pages.
|
|
31
|
+
# There are two ways to allow Rails to rescue exceptions:
|
|
32
|
+
#
|
|
33
|
+
# 1) Tag your scenario (or feature) with @allow-rescue
|
|
34
|
+
#
|
|
35
|
+
# 2) Set the value below to true. Beware that doing this globally is not
|
|
36
|
+
# recommended as it will mask a lot of errors for you!
|
|
37
|
+
#
|
|
38
|
+
ActionController::Base.allow_rescue = false
|
|
39
|
+
|
|
40
|
+
# Remove/comment out the lines below if your app doesn't have a database.
|
|
41
|
+
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
|
|
42
|
+
|
|
43
|
+
begin
|
|
44
|
+
require 'database_cleaner'
|
|
45
|
+
require 'database_cleaner/cucumber'
|
|
46
|
+
|
|
47
|
+
DatabaseCleaner.strategy = :transaction
|
|
48
|
+
rescue NameError
|
|
49
|
+
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
Before do
|
|
53
|
+
DatabaseCleaner.start
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
After do |scenario|
|
|
57
|
+
DatabaseCleaner.clean
|
|
58
|
+
end
|
|
59
|
+
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
|
|
60
|
+
# See the DatabaseCleaner documentation for details. Example:
|
|
61
|
+
#
|
|
62
|
+
Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
|
63
|
+
# # { :except => [:widgets] } may not do what you expect here
|
|
64
|
+
# # as Cucumber::Rails::Database.javascript_strategy overrides
|
|
65
|
+
# # this setting.
|
|
66
|
+
DatabaseCleaner.strategy = :truncation
|
|
67
|
+
end
|
|
68
|
+
#
|
|
69
|
+
Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
|
|
70
|
+
DatabaseCleaner.strategy = :transaction
|
|
71
|
+
end
|
|
72
|
+
#
|
|
73
|
+
|
|
74
|
+
# Possible values are :truncation and :transaction
|
|
75
|
+
# The :transaction strategy is faster, but might give you threading problems.
|
|
76
|
+
# See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature
|
|
77
|
+
Cucumber::Rails::Database.javascript_strategy = :truncation
|
|
78
|
+
#Capybara.default_driver = :webkit
|
|
79
|
+
Capybara.javascript_driver = :webkit
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
+
// listed below.
|
|
3
|
+
//
|
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
|
6
|
+
//
|
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
+
// compiled file.
|
|
9
|
+
//
|
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
|
11
|
+
// about supported directives.
|
|
12
|
+
//
|
|
13
|
+
/// From Underworld -----------------------------
|
|
14
|
+
//= require underworld/dashboard/application
|
|
15
|
+
|
|
16
|
+
//= require admin_lte/admin_lte
|
|
17
|
+
|
|
18
|
+
/// Underworld dashboard main application --------
|
|
19
|
+
//= require underworld/dashboard/application
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Underworld::Engine.load_seed
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
FactoryGirl.define do
|
|
2
|
+
factory :underworld_user, :class => Underworld::User do
|
|
3
|
+
email "admin@example.com"
|
|
4
|
+
first_name "admin"
|
|
5
|
+
last_name "admin"
|
|
6
|
+
password "123123123"
|
|
7
|
+
password_confirmation "123123123"
|
|
8
|
+
association :group, :factory => :underworld_group, :name => "admin"
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
4
|
+
require 'rspec/rails'
|
|
5
|
+
require 'rspec/autorun'
|
|
6
|
+
require 'factory_girl_rails'
|
|
7
|
+
require 'email_spec'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Rails.backtrace_cleaner.remove_silencers!
|
|
11
|
+
|
|
12
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
|
13
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
|
14
|
+
# run as spec files by default. This means that files in spec/support that end
|
|
15
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
|
16
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
|
17
|
+
# end with _spec.rb. You can configure this pattern with with the --pattern
|
|
18
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
|
19
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
|
20
|
+
|
|
21
|
+
# Checks for pending migrations before tests are run.
|
|
22
|
+
# If you are not using ActiveRecord, you can remove this line.
|
|
23
|
+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
|
24
|
+
|
|
25
|
+
RSpec.configure do |config|
|
|
26
|
+
config.include(EmailSpec::Helpers)
|
|
27
|
+
config.include(EmailSpec::Matchers)
|
|
28
|
+
|
|
29
|
+
# ## Mock Framework
|
|
30
|
+
#
|
|
31
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
|
32
|
+
#
|
|
33
|
+
# config.mock_with :mocha
|
|
34
|
+
# config.mock_with :flexmock
|
|
35
|
+
# config.mock_with :rr
|
|
36
|
+
config.mock_with :rspec
|
|
37
|
+
|
|
38
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
39
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
40
|
+
|
|
41
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
42
|
+
# examples within a transaction, remove the following line or assign false
|
|
43
|
+
# instead of true.
|
|
44
|
+
config.use_transactional_fixtures = true
|
|
45
|
+
|
|
46
|
+
# If true, the base class of anonymous controllers will be inferred
|
|
47
|
+
# automatically. This will be the default behavior in future versions of
|
|
48
|
+
# rspec-rails.
|
|
49
|
+
config.infer_base_class_for_anonymous_controllers = false
|
|
50
|
+
|
|
51
|
+
# Run specs in random order to surface order dependencies. If you find an
|
|
52
|
+
# order dependency and want to debug it, you can fix the order by providing
|
|
53
|
+
# the seed, which is printed after each run.
|
|
54
|
+
# --seed 1234
|
|
55
|
+
config.order = "random"
|
|
56
|
+
|
|
57
|
+
# database cleaner config
|
|
58
|
+
config.before(:suite) do
|
|
59
|
+
DatabaseCleaner.strategy = :truncation
|
|
60
|
+
end
|
|
61
|
+
config.before(:each) do
|
|
62
|
+
DatabaseCleaner.start
|
|
63
|
+
end
|
|
64
|
+
config.after(:each) do
|
|
65
|
+
DatabaseCleaner.clean
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Underworld::Engine.setup do |config|
|
|
2
|
+
# Logger settings for Underworld.
|
|
3
|
+
# Default value is the rails logger
|
|
4
|
+
# config.logger = Logger.new(STDOUT)
|
|
5
|
+
|
|
6
|
+
config.orm = 'active_record'
|
|
7
|
+
|
|
8
|
+
config.site_title = 'Underworld'
|
|
9
|
+
config.slug = 'Slug'
|
|
10
|
+
# Url prefix for dashboard section. default is '/dashboard'
|
|
11
|
+
# config.dashboard_namespace = :dashboard
|
|
12
|
+
end
|