mno-enterprise-frontend 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +1 -0
- data/Rakefile +12 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/mno_enterprise/impac/close-widget-pink.png +0 -0
- data/app/assets/images/mno_enterprise/impac/close-widget.png +0 -0
- data/app/assets/images/mno_enterprise/loader-32x32-bg-inverse.gif +0 -0
- data/app/assets/images/mno_enterprise/loader-32x32-bg-main.gif +0 -0
- data/app/assets/images/mno_enterprise/maestrano/logo-whitebg.png +0 -0
- data/app/assets/javascripts/mno_enterprise/angular/app.js.coffee.erb +173 -0
- data/app/assets/javascripts/mno_enterprise/angular/controllers/maestrano-controllers.js.coffee +4 -0
- data/app/assets/javascripts/mno_enterprise/angular/controllers/modals/modals-ctrl.js.coffee +62 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-account.js.coffee +157 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-app-deletion-request.js.coffee +62 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-apps-list.js.coffee +127 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-components.js.coffee +25 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace-app.js.coffee +77 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace.js.coffee +51 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-menu.js.coffee +174 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/arrears.js.coffee +70 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee +48 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/credit-card.js.coffee +142 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/index.js.coffee +61 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/invoices.js.coffee +42 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/members.js.coffee +280 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/settings.js.coffee +91 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/team-list.js.coffee +179 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/teams.js.coffee +268 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/file-model.js.coffee +33 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/maestrano-components.js.coffee +22 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-autostop-app.js.coffee +123 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-compile.js.coffee +18 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-currency-widget.js.coffee +43 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-current-currency.js.coffee +22 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-editable.js.coffee +68 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-flash-msg.js.coffee +40 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-helptext.js.coffee +38 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-loading-lounge.js.coffee +184 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-match.js.coffee +14 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-message-modal.js.coffee +56 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-notification-widget.js.coffee +192 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-code-popup.js.coffee +74 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-contact.js.coffee +59 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password-strength.js.coffee +154 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password.js.coffee +40 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-price-converter.js.coffee +49 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-scroll-to.js.coffee +14 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-typeahead.js.coffee +89 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/components.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/index.js.coffee +256 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-app-by-category.js.coffee +5 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-currency.js.coffee +30 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-filters.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-replace-underscore-with-space.js.coffee +4 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-titleize.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-truncate.js.coffee +24 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-app-instance.js.coffee +15 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-apps-document.js.coffee +83 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-user.js.coffee +27 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/organization-svc.js.coffee +318 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/team-svc.js.coffee +180 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/tickets-svc.js.coffee +109 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/impac-config.svc.js.coffee +35 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-apps-list-helper.js.coffee +337 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-assets.js.coffee.erb +21 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-currency.js.coffee +7 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-user-svc.js.coffee +99 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-exchange-rates.js.coffee +102 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-message-svc.js.coffee +71 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-miscellaneous.js.coffee.erb +46 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-modal.js.coffee +67 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-msg-bus.js.coffee +50 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-services.js.coffee +21 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-shopping-cart.js.coffee +361 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-utilities.js.coffee +61 -0
- data/app/assets/javascripts/mno_enterprise/angular/services/marketplace-svc.js.coffee +59 -0
- data/app/assets/javascripts/mno_enterprise/application.js +17 -0
- data/app/assets/javascripts/mno_enterprise/application_lib.js +14 -0
- data/app/assets/javascripts/mno_enterprise/lib/angular-really-click.js +17 -0
- data/app/assets/javascripts/mno_enterprise/lib/sortable.js +315 -0
- data/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js +5836 -0
- data/app/assets/javascripts/mno_enterprise/lib/xeditable.js +1588 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap.js +12 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/affix.js +162 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/alert.js +94 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/button.js +116 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/carousel.js +237 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/collapse.js +211 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/dropdown.js +161 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/modal.js +324 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/popover.js +113 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/scrollspy.js +175 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tab.js +153 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tooltip.js +472 -0
- data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/transition.js +59 -0
- data/app/assets/javascripts/ng-performance/ngPerformance.html +109 -0
- data/app/assets/javascripts/ng-performance/ngPerformance.js +211 -0
- data/app/assets/stylesheets/mno_enterprise/application.css +13 -0
- data/app/assets/stylesheets/mno_enterprise/custom/accordion.less +90 -0
- data/app/assets/stylesheets/mno_enterprise/custom/alert.less +30 -0
- data/app/assets/stylesheets/mno_enterprise/custom/angular-animate.less +42 -0
- data/app/assets/stylesheets/mno_enterprise/custom/angular-material.less +56 -0
- data/app/assets/stylesheets/mno_enterprise/custom/bootstrap-on-juice.less +22 -0
- data/app/assets/stylesheets/mno_enterprise/custom/button.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/custom/footer.less +44 -0
- data/app/assets/stylesheets/mno_enterprise/custom/form.less +191 -0
- data/app/assets/stylesheets/mno_enterprise/custom/header.less +281 -0
- data/app/assets/stylesheets/mno_enterprise/custom/impac-variables-override.less +65 -0
- data/app/assets/stylesheets/mno_enterprise/custom/modal.less +183 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utilities.less +729 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/app-presentation.less +77 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/banners.less +145 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/carousel.less +68 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/helptext.less +40 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/miscellaneous.less +134 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/progress-bar.less +55 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/step.less +101 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/tabset.less +87 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/testimonial.less +118 -0
- data/app/assets/stylesheets/mno_enterprise/custom/utility/text.less +23 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/apps.less +243 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/myspace.less +477 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/confirmation_lounge.less +31 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/home.less +57 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/pages/oauth-config-page.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/registration.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/star.less +18 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/bootstrap-wizard.less +63 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-marketplace.less +187 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-organization.less +149 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-teams.less +119 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/support.less +42 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/tickets.less +80 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/mno-editable.less +60 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/notification-widget.less +49 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/password-strength.less +28 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/shopping-cart.less +333 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/templates/star-wizard.less +49 -0
- data/app/assets/stylesheets/mno_enterprise/custom/views/user-setup.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/custom/xeditable.less +40 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-regular.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-sprockets.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome.less +16 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/FontAwesome.otf +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.svg +640 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/animated.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/bordered-pulled.less +25 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/core.less +12 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/extras.less +2 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/fixed-width.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/icons.less +677 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/larger.less +13 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/list.less +19 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/mixins.less +26 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/rotated-flipped.less +20 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/stacked.less +20 -0
- data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/variables.less +687 -0
- data/app/assets/stylesheets/mno_enterprise/main.less +132 -0
- data/app/assets/stylesheets/mno_enterprise/mixins.less +75 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/alerts.less +73 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/badges.less +65 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/bootstrap.less +50 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/breadcrumbs.less +26 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/button-groups.less +243 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/buttons.less +160 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/carousel.less +269 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/close.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/code.less +69 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/component-animations.less +34 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/dropdowns.less +214 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/forms.less +566 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/glyphicons.less +301 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/grid.less +84 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/input-groups.less +166 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/jumbotron.less +50 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/labels.less +64 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/list-group.less +124 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/media.less +61 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins.less +39 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/alerts.less +14 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/background-variant.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/border-radius.less +18 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/buttons.less +52 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/center-block.less +7 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/clearfix.less +22 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/forms.less +85 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/gradients.less +59 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid-framework.less +91 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid.less +122 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/hide-text.less +21 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/image.less +33 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/labels.less +12 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/list-group.less +29 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-divider.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-vertical-align.less +9 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/opacity.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/pagination.less +23 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/panels.less +24 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/progress-bar.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/reset-filter.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/resize.less +6 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/responsive-visibility.less +15 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/size.less +10 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/tab-focus.less +9 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/table-row.less +28 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-emphasis.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-overflow.less +8 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/vendor-prefixes.less +227 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/modals.less +148 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navbar.less +661 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navs.less +244 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/normalize.less +427 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pager.less +54 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pagination.less +88 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/panels.less +265 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/popovers.less +135 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/print.less +107 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/progress-bars.less +87 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-embed.less +35 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-utilities.less +194 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/scaffolding.less +150 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tables.less +234 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/theme.less +273 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/thumbnails.less +36 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tooltip.less +103 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/type.less +302 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/utilities.less +56 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/variables.less +857 -0
- data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/wells.less +29 -0
- data/app/assets/stylesheets/mno_enterprise/variables.less +226 -0
- data/app/assets/templates/mno_enterprise/dashboard/account.html +131 -0
- data/app/assets/templates/mno_enterprise/dashboard/app_deletion.html +36 -0
- data/app/assets/templates/mno_enterprise/dashboard/apps_list.html +103 -0
- data/app/assets/templates/mno_enterprise/dashboard/horizontal_menu.html +85 -0
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/index.html +60 -0
- data/app/assets/templates/mno_enterprise/dashboard/marketplace/show.html +133 -0
- data/app/assets/templates/mno_enterprise/dashboard/menu.html +161 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/arrears.html +37 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/billing.html +37 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/credit-card.html +156 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.full.html +181 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/index.html +173 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/invoices.html +27 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/members.html +288 -0
- data/app/assets/templates/mno_enterprise/dashboard/organization/settings.html +55 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/index.html +175 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-add-modal.html +60 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/member-removal-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-add-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-delete-modal.html +35 -0
- data/app/assets/templates/mno_enterprise/dashboard/teams/team-list.html +107 -0
- data/app/assets/templates/mno_enterprise/default_template.html +20 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/autostop_app.html +42 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/currency_widget.html +1 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/editable.html +28 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/loading_lounge.html +63 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/congratulations.html +8 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/default.html +1 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/information.html +8 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/notification-widget.html +31 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/password.html +55 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/star_wizard.html +254 -0
- data/app/assets/templates/mno_enterprise/maestrano-components/upload_spreadsheet.html +191 -0
- data/app/assets/templates/mno_enterprise/modals/new-organization-reseller-req.html +35 -0
- data/app/assets/templates/mno_enterprise/modals/new-organization.html +35 -0
- data/app/assets/templates/mno_enterprise/user-setup/index.html +312 -0
- data/app/controllers/mno_enterprise/invoices_controller.rb +22 -0
- data/app/controllers/mno_enterprise/pages_controller.rb +9 -0
- data/app/controllers/mno_enterprise/user_setup_controller.rb +11 -0
- data/app/views/layouts/mno_enterprise/_application_js.html.haml +17 -0
- data/app/views/layouts/mno_enterprise/_common_cdn_lib_js.html.haml +19 -0
- data/app/views/layouts/mno_enterprise/_footer_files.html.haml +5 -0
- data/app/views/layouts/mno_enterprise/_header_files.html.haml +31 -0
- data/app/views/layouts/mno_enterprise/_impersonate_header.html.haml +7 -0
- data/app/views/layouts/mno_enterprise/_public_page_header.html.haml +2 -0
- data/app/views/layouts/mno_enterprise/application.html.haml +18 -0
- data/app/views/layouts/mno_enterprise/application_dashboard.html.haml +22 -0
- data/app/views/layouts/mno_enterprise/third_party/_google_tag_container.html.haml +10 -0
- data/app/views/mno_enterprise/pages/app_access_unauthorized.html.haml +19 -0
- data/app/views/mno_enterprise/pages/app_logout.html.haml +18 -0
- data/app/views/mno_enterprise/pages/billing_details_required.html.haml +19 -0
- data/app/views/mno_enterprise/pages/loading.html.haml +3 -0
- data/app/views/mno_enterprise/pages/myspace.html.haml +6 -0
- data/app/views/mno_enterprise/provision/_provision_apps.html.haml +43 -0
- data/app/views/mno_enterprise/provision/_select_organization.html.haml +17 -0
- data/app/views/mno_enterprise/provision/new.html.haml +4 -0
- data/app/views/mno_enterprise/user_setup/index.html.haml +2 -0
- data/config/initializers/ng-annotate.rb +3 -0
- data/config/initializers/ng-performance.rb +3 -0
- data/config/routes.rb +19 -0
- data/lib/assets/javascripts/impac-angular.js +8719 -0
- data/lib/assets/stylesheets/impac-angular.less +2352 -0
- data/lib/mno-enterprise-frontend.rb +1 -0
- data/lib/mno_enterprise/frontend.rb +13 -0
- data/lib/mno_enterprise/frontend/assets_util.rb +47 -0
- data/lib/mno_enterprise/frontend/concerns/README.md +6 -0
- data/lib/mno_enterprise/frontend/concerns/controllers/pages_controller.rb +25 -0
- data/lib/mno_enterprise/frontend/engine.rb +13 -0
- data/spec/controllers/mno_enterprise/auth/confirmations_controller_spec.rb +84 -0
- data/spec/controllers/mno_enterprise/invoices_controller_spec.rb +34 -0
- data/spec/controllers/mno_enterprise/pages_controller_spec.rb +42 -0
- data/spec/controllers/mno_enterprise/user_setup_controller_spec.rb +33 -0
- data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +76 -0
- data/spec/rails_helper.rb +92 -0
- data/spec/routing/mno_enterprise/invoices_controller_routing_spec.rb +11 -0
- data/spec/routing/mno_enterprise/pages_controller_routing_spec.rb +18 -0
- data/spec/routing/mno_enterprise/user_setup_controller_routing_spec.rb +11 -0
- data/spec/spec_helper.rb +78 -0
- metadata +464 -0
@@ -0,0 +1 @@
|
|
1
|
+
require 'mno_enterprise/frontend'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'less-rails'
|
2
|
+
require 'jquery-rails'
|
3
|
+
require 'haml'
|
4
|
+
require 'ngannotate-rails'
|
5
|
+
|
6
|
+
require 'mno_enterprise/api'
|
7
|
+
|
8
|
+
module MaestranoEnterprise
|
9
|
+
module Frontend
|
10
|
+
require 'mno_enterprise/frontend/engine'
|
11
|
+
require 'mno_enterprise/frontend/assets_util'
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Used by assets.js.erb to reference
|
2
|
+
# images from Asset pipeline
|
3
|
+
module MnoEnterprise
|
4
|
+
module Frontend
|
5
|
+
module AssetsUtil
|
6
|
+
def self.assets_url
|
7
|
+
self.config["environments"][Rails.env]["assets"]
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.server_host
|
11
|
+
self.config["environments"][Rails.env]["host"]
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.config
|
15
|
+
@@config ||= YAML.load_file(File.join(Rails.root, 'config', 'assets.yml'))
|
16
|
+
|
17
|
+
@@config
|
18
|
+
end
|
19
|
+
|
20
|
+
# Return the application root path
|
21
|
+
def self.root_path
|
22
|
+
Rails.root
|
23
|
+
end
|
24
|
+
|
25
|
+
# Return the engine root path
|
26
|
+
def self.engine_root_path
|
27
|
+
MnoEnterprise::Frontend::Engine.root
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.images
|
31
|
+
[self.root_path, self.engine_root_path].map do |base_path|
|
32
|
+
Dir.glob(base_path.join("app/assets/images/**/*.*")).map do |path|
|
33
|
+
path.gsub(base_path.join("app/assets/images/").to_s, "")
|
34
|
+
end
|
35
|
+
end.flatten.uniq
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.templates
|
39
|
+
[self.root_path, self.engine_root_path].map do |base_path|
|
40
|
+
Dir.glob(base_path.join("app/assets/templates/**/*.*")).map do |path|
|
41
|
+
path.gsub(base_path.join("app/assets/templates/").to_s, "")
|
42
|
+
end
|
43
|
+
end.flatten.uniq
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module MnoEnterprise::Frontend::Concerns::Controllers::PagesController
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
#==================================================================
|
5
|
+
# Included methods
|
6
|
+
#==================================================================
|
7
|
+
# 'included do' causes the included code to be evaluated in the
|
8
|
+
# context where it is included rather than being executed in the module's context
|
9
|
+
included do
|
10
|
+
# including :launch from mnoe/api as before_filter with only redefine the filter
|
11
|
+
before_filter :authenticate_user!, only: [:myspace, :launch]
|
12
|
+
before_filter :redirect_to_lounge_if_unconfirmed, only: [:myspace, :launch]
|
13
|
+
end
|
14
|
+
|
15
|
+
#==================================================================
|
16
|
+
# Instance methods
|
17
|
+
#==================================================================
|
18
|
+
# GET /myspace
|
19
|
+
def myspace
|
20
|
+
# Meta Information
|
21
|
+
@meta[:title] = "Dashboard"
|
22
|
+
@meta[:description] = "Dashboard"
|
23
|
+
render layout: 'mno_enterprise/application_dashboard'
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module MnoEnterprise
|
2
|
+
module Frontend
|
3
|
+
class Engine < ::Rails::Engine
|
4
|
+
isolate_namespace MnoEnterprise
|
5
|
+
|
6
|
+
# Add assets
|
7
|
+
config.assets.precompile += %w( mno_enterprise/application_lib.js )
|
8
|
+
|
9
|
+
# To be able to load lib/mno_enterprise/concerns/...
|
10
|
+
config.autoload_paths += Dir["#{config.root}/lib/**/"]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
module MnoEnterprise
|
4
|
+
module Auth
|
5
|
+
|
6
|
+
describe ConfirmationsController, type: :controller do
|
7
|
+
render_views
|
8
|
+
routes { MnoEnterprise::Engine.routes }
|
9
|
+
before { request.env["devise.mapping"] = Devise.mappings[:user] } #bypass devise router
|
10
|
+
|
11
|
+
|
12
|
+
let(:user) { build(:user) }
|
13
|
+
let(:new_email) { user.email + '.au' }
|
14
|
+
let(:email_params) {{ filter: { email: user.email }, limit: 1 }}
|
15
|
+
let(:new_email_params) {{ filter: { email: new_email }, limit: 1 }}
|
16
|
+
|
17
|
+
before { allow(MnoEnterprise::User).to receive(:find_for_confirmation).with(any_args).and_return(user) }
|
18
|
+
|
19
|
+
before { api_stub_for(get: "/users", params: email_params, respond_with: []) }
|
20
|
+
before { api_stub_for(get: "/users", respond_with: [user]) }
|
21
|
+
before { api_stub_for(get: "/org_invites", respond_with: []) }
|
22
|
+
before { api_stub_for(get: "/users/#{user.id}/organizations", respond_with: []) }
|
23
|
+
|
24
|
+
before { api_stub_for(put: "/users/#{user.id}", respond_with: user) }
|
25
|
+
|
26
|
+
|
27
|
+
describe 'GET #show' do
|
28
|
+
subject { get :show, confirmation_token: user.confirmation_token }
|
29
|
+
|
30
|
+
describe 'confirmed user confirming new email address' do
|
31
|
+
before { user.unconfirmed_email = new_email }
|
32
|
+
|
33
|
+
before { subject }
|
34
|
+
it { expect(user.email).to eq(new_email) }
|
35
|
+
it { expect(response).to redirect_to(root_path) }
|
36
|
+
end
|
37
|
+
|
38
|
+
describe 'unconfirmed user' do
|
39
|
+
before { user.confirmed_at = nil }
|
40
|
+
before { subject }
|
41
|
+
it { expect(response.code).to eq('200') }
|
42
|
+
it { expect(assigns(:confirmation_token)).to eq(user.confirmation_token) }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe 'PATCH #finalize' do
|
47
|
+
let(:previous_url) { nil }
|
48
|
+
let(:user_params) {{ name: 'Robert', surname: 'Jack', password: 'somepassword', confirmation_token: user.confirmation_token }}
|
49
|
+
subject { patch :finalize, user: user_params }
|
50
|
+
|
51
|
+
before { session[:previous_url] = previous_url }
|
52
|
+
|
53
|
+
describe 'confirmed user' do
|
54
|
+
before { subject }
|
55
|
+
it { expect(user.name).to_not eq(user_params[:name]) }
|
56
|
+
it { expect(response).to redirect_to(root_path) }
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'unconfirmed user' do
|
60
|
+
before { user.confirmed_at = nil }
|
61
|
+
before { subject }
|
62
|
+
it { expect(user.name).to eq(user_params[:name]) }
|
63
|
+
it { expect(user.surname).to eq(user_params[:surname]) }
|
64
|
+
it { expect(user.password).to eq(user_params[:password]) }
|
65
|
+
it { expect(response).to redirect_to('/mnoe/myspace') }
|
66
|
+
|
67
|
+
describe 'with previous url' do
|
68
|
+
let(:previous_url) { "/some/redirection" }
|
69
|
+
it { expect(response).to redirect_to(previous_url) }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe 'invalid confirmation token ' do
|
74
|
+
let(:user_with_errors) { obj = MnoEnterprise::User.new; obj.errors[:base] << "Invalid confirmation token"; obj }
|
75
|
+
before { allow(MnoEnterprise::User).to receive(:find_for_confirmation).with(any_args).and_return(user_with_errors) }
|
76
|
+
subject! { patch :finalize, user: user_params.merge(confirmation_token: 'invalid') }
|
77
|
+
it { expect(user.name).to_not eq(user_params[:name]) }
|
78
|
+
it { expect(response.code).to eq('200') }
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
module MnoEnterprise
|
4
|
+
describe InvoicesController, type: :controller do
|
5
|
+
render_views
|
6
|
+
routes { MnoEnterprise::Engine.routes }
|
7
|
+
|
8
|
+
# Stub controller ability
|
9
|
+
let!(:ability) { stub_ability }
|
10
|
+
before { allow(ability).to receive(:can?).with(any_args).and_return(true) }
|
11
|
+
|
12
|
+
# Stub model calls
|
13
|
+
let(:user) { build(:user) }
|
14
|
+
let(:organization) { build(:organization) }
|
15
|
+
let(:invoice) { build(:invoice, organization_id: organization.id) }
|
16
|
+
before { api_stub_for(get: "/users/#{user.id}", response: from_api(user)) }
|
17
|
+
before { api_stub_for(get: "/organizations/#{organization.id}", response: from_api(organization)) }
|
18
|
+
before { api_stub_for(get: "/users/#{user.id}/organizations/#{organization.id}", response: from_api(organization)) }
|
19
|
+
before { api_stub_for(get: "/invoices", params: { filter: { slug: '**' } }, response: from_api([invoice])) }
|
20
|
+
|
21
|
+
|
22
|
+
describe "GET #show" do
|
23
|
+
before { sign_in user }
|
24
|
+
subject { get :show, id: invoice.slug }
|
25
|
+
|
26
|
+
it_behaves_like "a navigatable protected user action"
|
27
|
+
it_behaves_like "a user protected resource"
|
28
|
+
|
29
|
+
it { subject; expect(response).to be_success }
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
module MnoEnterprise
|
4
|
+
describe PagesController, type: :controller do
|
5
|
+
render_views
|
6
|
+
routes { MnoEnterprise::Engine.routes }
|
7
|
+
|
8
|
+
let(:user) { build(:user) }
|
9
|
+
before { api_stub_for(get: "/users/#{user.id}", response: from_api(user)) }
|
10
|
+
before { api_stub_for(put: "/users/#{user.id}", response: from_api(user)) }
|
11
|
+
|
12
|
+
describe "GET #myspace" do
|
13
|
+
before { sign_in user }
|
14
|
+
subject { get :myspace }
|
15
|
+
|
16
|
+
it_behaves_like "a navigatable protected user action"
|
17
|
+
|
18
|
+
it "assigns the right meta information" do
|
19
|
+
get :myspace
|
20
|
+
meta = {}
|
21
|
+
meta[:title] = "Dashboard"
|
22
|
+
meta[:description] = "Dashboard"
|
23
|
+
expect(assigns(:meta)).to eq(meta)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# To be sure that we don't loose pages define in mnoe-api
|
28
|
+
describe 'GET #launch' do
|
29
|
+
let(:app_instance) { build(:app_instance) }
|
30
|
+
before { sign_in user }
|
31
|
+
before { api_stub_for(get: "/app_instances", response: from_api([app_instance])) }
|
32
|
+
subject { get :launch, id: app_instance.uid }
|
33
|
+
|
34
|
+
it_behaves_like "a navigatable protected user action"
|
35
|
+
|
36
|
+
it 'redirect to the mno enterprise launch page with a web token' do
|
37
|
+
subject
|
38
|
+
expect(response).to redirect_to(MnoEnterprise.router.launch_url(app_instance.uid, wtk: MnoEnterprise.jwt({user_id: user.uid})))
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
module MnoEnterprise
|
4
|
+
describe UserSetupController, type: :controller do
|
5
|
+
render_views
|
6
|
+
routes { MnoEnterprise::Engine.routes }
|
7
|
+
|
8
|
+
# Create user and organization + mutual associations
|
9
|
+
let(:organization) { build(:organization) }
|
10
|
+
let(:user) { build(:user) }
|
11
|
+
before { api_stub_for(get: "/users/#{user.id}", response: from_api(user)) }
|
12
|
+
before { allow(organization).to receive(:users).and_return([user]) }
|
13
|
+
before { allow_any_instance_of(User).to receive(:organizations).and_return([organization]) }
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
describe 'GET #index' do
|
18
|
+
subject { get :index }
|
19
|
+
|
20
|
+
describe 'guest' do
|
21
|
+
before { subject }
|
22
|
+
it { expect(response).to redirect_to(new_user_session_path) }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'signed in' do
|
26
|
+
before { sign_in user }
|
27
|
+
before { subject }
|
28
|
+
it { expect(response).to be_success }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
# Test here in addition to mnoe-api to see that it's working properly with myspace_url
|
4
|
+
module MnoEnterprise
|
5
|
+
describe Webhook::OAuthController, type: :controller do
|
6
|
+
render_views
|
7
|
+
routes { MnoEnterprise::Engine.routes }
|
8
|
+
|
9
|
+
# Stub controller ability
|
10
|
+
let!(:ability) { stub_ability }
|
11
|
+
let(:extra_params) { {some: 'param'} }
|
12
|
+
before { allow(ability).to receive(:can?).with(any_args).and_return(true) }
|
13
|
+
|
14
|
+
# Stub model calls
|
15
|
+
let(:user) { build(:user) }
|
16
|
+
let(:organization) { build(:organization) }
|
17
|
+
let(:app) { build(:app) }
|
18
|
+
let(:app_instance) { build(:app_instance) }
|
19
|
+
before { api_stub_for(get: "/users/#{user.id}", response: from_api(user)) }
|
20
|
+
before { api_stub_for(get: "/app_instances", response: from_api([app_instance])) }
|
21
|
+
before { allow_any_instance_of(MnoEnterprise::AppInstance).to receive(:app).and_return(app) }
|
22
|
+
|
23
|
+
describe 'GET #authorize' do
|
24
|
+
let(:redir_params) { extra_params.reject { |k, v| k.to_sym == :perform } }
|
25
|
+
let(:redirect_url) { MnoEnterprise.router.authorize_oauth_url(app_instance.uid, redir_params.merge(wtk: MnoEnterprise.jwt(user_id: user.uid))) }
|
26
|
+
subject { get :authorize, extra_params.merge(id: app_instance.uid) }
|
27
|
+
before { sign_in user }
|
28
|
+
|
29
|
+
it_behaves_like "a navigatable protected user action"
|
30
|
+
it_behaves_like "a user protected resource"
|
31
|
+
|
32
|
+
it { subject; expect(response).to be_success }
|
33
|
+
it { subject; expect(assigns(:redirect_to)).to eq(redirect_url) }
|
34
|
+
|
35
|
+
Webhook::OAuthController::PROVIDERS_WITH_OPTIONS.each do |provider|
|
36
|
+
describe "#{provider.capitalize} provider" do
|
37
|
+
let(:app) { build(:app, nid: provider.parameterize) }
|
38
|
+
it { subject; expect(response).to render_template("providers/#{provider.parameterize}") }
|
39
|
+
|
40
|
+
context 'with perform=true' do
|
41
|
+
let(:extra_params) { {perform: true} }
|
42
|
+
it { subject; expect(assigns(:redirect_to)).to eq(redirect_url) }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe 'GET #callback' do
|
49
|
+
subject { get :callback, id: app_instance.uid }
|
50
|
+
|
51
|
+
it { subject; expect(response).to redirect_to(myspace_path) }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'GET #disconnect' do
|
55
|
+
let(:redirect_url) { MnoEnterprise.router.disconnect_oauth_url(app_instance.uid, extra_params.merge(wtk: MnoEnterprise.jwt(user_id: user.uid))) }
|
56
|
+
subject { get :disconnect, extra_params.merge(id: app_instance.uid) }
|
57
|
+
before { sign_in user }
|
58
|
+
|
59
|
+
it_behaves_like "a navigatable protected user action"
|
60
|
+
it_behaves_like "a user protected resource"
|
61
|
+
|
62
|
+
it { subject; expect(response).to redirect_to(redirect_url) }
|
63
|
+
end
|
64
|
+
|
65
|
+
describe 'GET #sync' do
|
66
|
+
let(:redirect_url) { MnoEnterprise.router.sync_oauth_url(app_instance.uid, extra_params.merge(wtk: MnoEnterprise.jwt(user_id: user.uid))) }
|
67
|
+
before { sign_in user }
|
68
|
+
subject { get :sync, extra_params.merge(id: app_instance.uid) }
|
69
|
+
|
70
|
+
it_behaves_like "a navigatable protected user action"
|
71
|
+
it_behaves_like "a user protected resource"
|
72
|
+
|
73
|
+
it { subject; expect(response).to redirect_to(redirect_url) }
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'her'
|
5
|
+
require 'factory_girl_rails'
|
6
|
+
require 'fakeweb'
|
7
|
+
|
8
|
+
require 'mno_enterprise/testing_support/user_action_shared'
|
9
|
+
|
10
|
+
# Load the Dummy application
|
11
|
+
begin
|
12
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
13
|
+
rescue LoadError
|
14
|
+
puts "Could not load dummy application. Please ensure you have run `bundle exec rake test_app`"
|
15
|
+
end
|
16
|
+
# require File.expand_path("../../spec/dummy/config/environment.rb", __FILE__)
|
17
|
+
|
18
|
+
require 'rspec/rails'
|
19
|
+
|
20
|
+
# Check Dummy application migrations
|
21
|
+
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../spec/dummy/db/migrate", __FILE__)]
|
22
|
+
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
|
23
|
+
|
24
|
+
|
25
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
26
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
27
|
+
# run as spec files by default. This means that files in spec/support that end
|
28
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
29
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
30
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
31
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
32
|
+
Dir[Rails.root.join("../..","spec/support/**/*.rb")].each { |f| require f }
|
33
|
+
|
34
|
+
# Require all factories
|
35
|
+
# Dir[Rails.root.join("../..", "spec/factories/**/*.rb")].each {|f| require f }
|
36
|
+
require 'mno_enterprise/testing_support/factories'
|
37
|
+
|
38
|
+
# Checks for pending migrations before tests are run.
|
39
|
+
# If you are not using ActiveRecord, you can remove this line.
|
40
|
+
ActiveRecord::Migration.maintain_test_schema!
|
41
|
+
|
42
|
+
RSpec.configure do |config|
|
43
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
44
|
+
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
45
|
+
|
46
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
47
|
+
# examples within a transaction, remove the following line or assign false
|
48
|
+
# instead of true.
|
49
|
+
# config.use_transactional_fixtures = true
|
50
|
+
|
51
|
+
# Include FactoryGirl methods to avoid typing FactoryGirl.create(...)
|
52
|
+
config.include FactoryGirl::Syntax::Methods
|
53
|
+
|
54
|
+
# Include MnoEnterpriseApiTestHelper
|
55
|
+
# Enable API stub helpers (e.g.: api_stub_for)
|
56
|
+
config.include MnoEnterpriseApiTestHelper
|
57
|
+
|
58
|
+
# Include ability test helper
|
59
|
+
config.include AbilityTestHelper, type: :controller
|
60
|
+
|
61
|
+
# Include devise tests
|
62
|
+
config.include Devise::TestHelpers, type: :controller
|
63
|
+
|
64
|
+
# Reset API stubs before each step
|
65
|
+
config.before :each do
|
66
|
+
api_stub_reset
|
67
|
+
end
|
68
|
+
|
69
|
+
config.before(:suite) do
|
70
|
+
FakeWeb.allow_net_connect = false
|
71
|
+
FakeWeb.register_uri(:post, 'https://my_tenant_id:my_tenant_access_key@api-enterprise.maestrano.com/api/mnoe/v1/audit_events', status: 200)
|
72
|
+
end
|
73
|
+
|
74
|
+
config.after(:suite) do
|
75
|
+
FakeWeb.allow_net_connect = true
|
76
|
+
end
|
77
|
+
|
78
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
79
|
+
# based on their file location, for example enabling you to call `get` and
|
80
|
+
# `post` in specs under `spec/controllers`.
|
81
|
+
#
|
82
|
+
# You can disable this behaviour by removing the line below, and instead
|
83
|
+
# explicitly tag your specs with their type, e.g.:
|
84
|
+
#
|
85
|
+
# RSpec.describe UsersController, :type => :controller do
|
86
|
+
# # ...
|
87
|
+
# end
|
88
|
+
#
|
89
|
+
# The different available types are documented in the features, such as in
|
90
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
91
|
+
config.infer_spec_type_from_file_location!
|
92
|
+
end
|