xing-framework 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/default_configuration/base_app/API_DOC/README +23 -0
  3. data/default_configuration/base_app/API_DOC/admin-menus +167 -0
  4. data/default_configuration/base_app/API_DOC/admin-pages +173 -0
  5. data/default_configuration/base_app/API_DOC/content-block +10 -0
  6. data/default_configuration/base_app/API_DOC/navigation +54 -0
  7. data/default_configuration/base_app/API_DOC/page +38 -0
  8. data/default_configuration/base_app/CHANGELOG.md +122 -0
  9. data/default_configuration/base_app/Capfile +26 -0
  10. data/default_configuration/base_app/Gemfile +7 -0
  11. data/default_configuration/base_app/Gemfile.lock +155 -0
  12. data/default_configuration/base_app/README.md +24 -0
  13. data/default_configuration/base_app/Rakefile +25 -0
  14. data/default_configuration/base_app/backend/Gemfile +45 -0
  15. data/default_configuration/base_app/backend/Gemfile.lock +292 -0
  16. data/default_configuration/base_app/backend/README +12 -0
  17. data/default_configuration/base_app/backend/Rakefile +10 -0
  18. data/default_configuration/base_app/backend/app/controllers/application_controller.rb +3 -0
  19. data/default_configuration/base_app/backend/app/controllers/confirmations_controller.rb +3 -0
  20. data/default_configuration/base_app/backend/app/controllers/passwords_controller.rb +3 -0
  21. data/default_configuration/base_app/backend/app/controllers/registrations_controller.rb +15 -0
  22. data/default_configuration/base_app/backend/app/models/ability.rb +13 -0
  23. data/default_configuration/base_app/backend/app/models/role/admin.rb +8 -0
  24. data/default_configuration/base_app/backend/app/models/user.rb +43 -0
  25. data/default_configuration/base_app/backend/autotest/discover.rb +2 -0
  26. data/default_configuration/base_app/backend/bin/bundle +3 -0
  27. data/default_configuration/base_app/backend/bin/rails +4 -0
  28. data/default_configuration/base_app/backend/bin/rake +4 -0
  29. data/default_configuration/base_app/backend/config.ru +6 -0
  30. data/default_configuration/base_app/backend/config/application.rb +71 -0
  31. data/default_configuration/base_app/backend/config/boot.rb +4 -0
  32. data/default_configuration/base_app/backend/config/database.yml.ci +9 -0
  33. data/default_configuration/base_app/backend/config/database.yml.example +22 -0
  34. data/default_configuration/base_app/backend/config/environment.rb +5 -0
  35. data/default_configuration/base_app/backend/config/environments/development.rb +45 -0
  36. data/default_configuration/base_app/backend/config/environments/production.rb +78 -0
  37. data/default_configuration/base_app/backend/config/environments/staging.rb +48 -0
  38. data/default_configuration/base_app/backend/config/environments/test.rb +47 -0
  39. data/default_configuration/base_app/backend/config/initializers/assets.rb +8 -0
  40. data/default_configuration/base_app/backend/config/initializers/backtrace_silencers.rb +7 -0
  41. data/default_configuration/base_app/backend/config/initializers/constants.rb +1 -0
  42. data/default_configuration/base_app/backend/config/initializers/cookies_serializer.rb +3 -0
  43. data/default_configuration/base_app/backend/config/initializers/devise.rb +241 -0
  44. data/default_configuration/base_app/backend/config/initializers/devise_token_auth.rb +22 -0
  45. data/default_configuration/base_app/backend/config/initializers/filter_parameter_logging.rb +4 -0
  46. data/default_configuration/base_app/backend/config/initializers/inflections.rb +16 -0
  47. data/default_configuration/base_app/backend/config/initializers/mime_types.rb +4 -0
  48. data/default_configuration/base_app/backend/config/initializers/session_store.rb +3 -0
  49. data/default_configuration/base_app/backend/config/initializers/smtp.rb +25 -0
  50. data/default_configuration/base_app/backend/config/initializers/time_formats.rb +12 -0
  51. data/default_configuration/base_app/backend/config/initializers/wrap_parameters.rb +14 -0
  52. data/default_configuration/base_app/backend/config/locales/en.yml +23 -0
  53. data/default_configuration/base_app/backend/config/locales/json.yml +29 -0
  54. data/default_configuration/base_app/backend/config/routes.rb +33 -0
  55. data/default_configuration/base_app/backend/config/secrets.yml.ci +22 -0
  56. data/default_configuration/base_app/backend/config/secrets.yml.example +57 -0
  57. data/default_configuration/base_app/backend/config/sidekiq.yml +4 -0
  58. data/default_configuration/base_app/backend/db/sample_data/users.rake +10 -0
  59. data/default_configuration/base_app/backend/db/seeds.rb +14 -0
  60. data/default_configuration/base_app/backend/lib/static-app.rb +15 -0
  61. data/default_configuration/base_app/backend/public/404.html +26 -0
  62. data/default_configuration/base_app/backend/public/422.html +26 -0
  63. data/default_configuration/base_app/backend/public/500.html +26 -0
  64. data/default_configuration/base_app/backend/public/favicon.ico +0 -0
  65. data/default_configuration/base_app/backend/public/index.html +0 -0
  66. data/default_configuration/base_app/backend/public/robots.txt +5 -0
  67. data/default_configuration/base_app/backend/script/rails +6 -0
  68. data/default_configuration/base_app/backend/spec/factories/user_sessions_factory.rb +6 -0
  69. data/default_configuration/base_app/backend/spec/factories/users_factory.rb +35 -0
  70. data/default_configuration/base_app/backend/spec/features/user_sends_reset_password_email_spec.rb +30 -0
  71. data/default_configuration/base_app/backend/spec/features/user_signs_up_spec.rb +32 -0
  72. data/default_configuration/base_app/backend/spec/models/role/admin_spec.rb +12 -0
  73. data/default_configuration/base_app/backend/spec/models/role_spec.rb +48 -0
  74. data/default_configuration/base_app/backend/spec/models/user_spec.rb +59 -0
  75. data/default_configuration/base_app/backend/spec/requests/resources_index_spec.rb +22 -0
  76. data/default_configuration/base_app/backend/spec/spec_helper.rb +65 -0
  77. data/default_configuration/base_app/backend/spec/support/devise_helper.rb +78 -0
  78. data/default_configuration/base_app/backend/spec/support/log_tests.rb +5 -0
  79. data/default_configuration/base_app/backend/spec/support/session_helpers.rb +67 -0
  80. data/default_configuration/base_app/backend/spec/tasks/sample_data_rake_spec.rb +17 -0
  81. data/default_configuration/base_app/backend/static-app.ru +3 -0
  82. data/default_configuration/base_app/codeclimate.yml +7 -0
  83. data/default_configuration/base_app/config/compass.rb +21 -0
  84. data/default_configuration/base_app/config/deploy.rb +157 -0
  85. data/default_configuration/base_app/config/deploy/bundle-config +4 -0
  86. data/default_configuration/base_app/config/deploy/production.rb +7 -0
  87. data/default_configuration/base_app/config/deploy/staging.rb +6 -0
  88. data/default_configuration/base_app/doc/01_fail_resources.txt +173 -0
  89. data/default_configuration/base_app/doc/02_fail_auth.txt +165 -0
  90. data/default_configuration/base_app/doc/03_fail_menus.txt +174 -0
  91. data/default_configuration/base_app/dummy-api/admin/menu_items/10.json +15 -0
  92. data/default_configuration/base_app/dummy-api/admin/menu_items/11.json +15 -0
  93. data/default_configuration/base_app/dummy-api/admin/menu_items/12.json +15 -0
  94. data/default_configuration/base_app/dummy-api/admin/menu_items/13.json +15 -0
  95. data/default_configuration/base_app/dummy-api/admin/menu_items/14.json +15 -0
  96. data/default_configuration/base_app/dummy-api/admin/menu_items/15.json +15 -0
  97. data/default_configuration/base_app/dummy-api/admin/menu_items/16.json +15 -0
  98. data/default_configuration/base_app/dummy-api/admin/menus.json +23 -0
  99. data/default_configuration/base_app/dummy-api/admin/menus/1.json +118 -0
  100. data/default_configuration/base_app/dummy-api/admin/menus/2.json +8 -0
  101. data/default_configuration/base_app/dummy-api/admin/pages.json +105 -0
  102. data/default_configuration/base_app/dummy-api/admin/pages/about_us.json +45 -0
  103. data/default_configuration/base_app/dummy-api/admin/pages/contact_us.json +36 -0
  104. data/default_configuration/base_app/dummy-api/admin/pages/gallery.json +36 -0
  105. data/default_configuration/base_app/dummy-api/admin/pages/home.json +36 -0
  106. data/default_configuration/base_app/dummy-api/admin/pages/homepage.json +18 -0
  107. data/default_configuration/base_app/dummy-api/admin/pages/links.json +36 -0
  108. data/default_configuration/base_app/dummy-api/admin/pages/newsletter.json +54 -0
  109. data/default_configuration/base_app/dummy-api/homepage.json +14 -0
  110. data/default_configuration/base_app/dummy-api/navigation/main.json +119 -0
  111. data/default_configuration/base_app/dummy-api/pages/about_us.json +41 -0
  112. data/default_configuration/base_app/dummy-api/pages/contact_us.json +32 -0
  113. data/default_configuration/base_app/dummy-api/pages/gallery.json +32 -0
  114. data/default_configuration/base_app/dummy-api/pages/home.json +32 -0
  115. data/default_configuration/base_app/dummy-api/pages/homepage.json +14 -0
  116. data/default_configuration/base_app/dummy-api/pages/links.json +32 -0
  117. data/default_configuration/base_app/dummy-api/pages/newsletter.json +50 -0
  118. data/default_configuration/base_app/dump.rdb +0 -0
  119. data/default_configuration/base_app/example-lrd-dev-tmux.conf +17 -0
  120. data/default_configuration/base_app/frontend/CHANGELOG.md +125 -0
  121. data/default_configuration/base_app/frontend/Gemfile +5 -0
  122. data/default_configuration/base_app/frontend/Gemfile.lock +34 -0
  123. data/default_configuration/base_app/frontend/Gruntfile.js +3 -0
  124. data/default_configuration/base_app/frontend/LICENSE +19 -0
  125. data/default_configuration/base_app/frontend/README.md +5 -0
  126. data/default_configuration/base_app/frontend/bin/index.html +0 -0
  127. data/default_configuration/base_app/frontend/build.config.js +110 -0
  128. data/default_configuration/base_app/frontend/changelog.tpl +23 -0
  129. data/default_configuration/base_app/frontend/config/compass.rb +33 -0
  130. data/default_configuration/base_app/frontend/config/environments/development.js +4 -0
  131. data/default_configuration/base_app/frontend/config/environments/integration.js +4 -0
  132. data/default_configuration/base_app/frontend/config/environments/production.js +3 -0
  133. data/default_configuration/base_app/frontend/config/environments/test.js +4 -0
  134. data/default_configuration/base_app/frontend/create +0 -0
  135. data/default_configuration/base_app/frontend/karma/karma-unit.tpl.js +80 -0
  136. data/default_configuration/base_app/frontend/module.prefix +1 -0
  137. data/default_configuration/base_app/frontend/module.suffix +1 -0
  138. data/default_configuration/base_app/frontend/npm-shrinkwrap.json +4334 -0
  139. data/default_configuration/base_app/frontend/package.json +75 -0
  140. data/default_configuration/base_app/frontend/sprockets/index.tpl.js +2 -0
  141. data/default_configuration/base_app/frontend/src/README.md +48 -0
  142. data/default_configuration/base_app/frontend/src/app/README.md +68 -0
  143. data/default_configuration/base_app/frontend/src/app/app.js +47 -0
  144. data/default_configuration/base_app/frontend/src/app/appConfig.js +19 -0
  145. data/default_configuration/base_app/frontend/src/app/auth/auth.js +66 -0
  146. data/default_configuration/base_app/frontend/src/app/auth/config.js +22 -0
  147. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmations-success.tpl.html +1 -0
  148. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmations.js +8 -0
  149. data/default_configuration/base_app/frontend/src/app/auth/confirmations/confirmationsStates.js +12 -0
  150. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-request-success.tpl.html +3 -0
  151. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-request.tpl.html +16 -0
  152. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-update-success.tpl.html +3 -0
  153. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords-update.tpl.html +21 -0
  154. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwords.js +11 -0
  155. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwordsControllers.js +47 -0
  156. data/default_configuration/base_app/frontend/src/app/auth/passwords/passwordsStates.js +38 -0
  157. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations-success.tpl.html +1 -0
  158. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations.js +14 -0
  159. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrations.tpl.html +37 -0
  160. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrationsControllers.js +25 -0
  161. data/default_configuration/base_app/frontend/src/app/auth/registrations/registrationsStates.js +18 -0
  162. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions-success.tpl.html +1 -0
  163. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions.js +18 -0
  164. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessions.tpl.html +25 -0
  165. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessionsControllers.js +26 -0
  166. data/default_configuration/base_app/frontend/src/app/auth/sessions/sessionsStates.js +20 -0
  167. data/default_configuration/base_app/frontend/src/app/homepage/homepage-show.tpl.html +2 -0
  168. data/default_configuration/base_app/frontend/src/app/homepage/homepage.js +10 -0
  169. data/default_configuration/base_app/frontend/src/app/homepage/homepage.tpl.html +13 -0
  170. data/default_configuration/base_app/frontend/src/app/homepage/homepageControllers.js +9 -0
  171. data/default_configuration/base_app/frontend/src/app/homepage/homepageStates.js +22 -0
  172. data/default_configuration/base_app/frontend/src/app/inner.tpl.html +16 -0
  173. data/default_configuration/base_app/frontend/src/app/root.tpl.html +2 -0
  174. data/default_configuration/base_app/frontend/src/app/rootController.js +8 -0
  175. data/default_configuration/base_app/frontend/src/app/rootStates.js +20 -0
  176. data/default_configuration/base_app/frontend/src/assets/README.md +4 -0
  177. data/default_configuration/base_app/frontend/src/assets/icons/alert.svg +1 -0
  178. data/default_configuration/base_app/frontend/src/common/README.md +19 -0
  179. data/default_configuration/base_app/frontend/src/common/components/OnLoginDirective/OnLoginDirective.js +17 -0
  180. data/default_configuration/base_app/frontend/src/common/components/adminOnly/admin-only.tpl.html +4 -0
  181. data/default_configuration/base_app/frontend/src/common/components/adminOnly/adminOnly.js +23 -0
  182. data/default_configuration/base_app/frontend/src/common/components/sessionLinks/session-links.tpl.html +5 -0
  183. data/default_configuration/base_app/frontend/src/common/components/sessionLinks/sessionLinks.js +25 -0
  184. data/default_configuration/base_app/frontend/src/common/components/signOut/signOut.js +19 -0
  185. data/default_configuration/base_app/frontend/src/common/config.js +27 -0
  186. data/default_configuration/base_app/frontend/src/index.html +86 -0
  187. data/default_configuration/base_app/frontend/src/styles/_constants.sass +14 -0
  188. data/default_configuration/base_app/frontend/src/styles/main.sass +52 -0
  189. data/default_configuration/base_app/frontend/src/styles/partials/_footer.sass +18 -0
  190. data/default_configuration/base_app/frontend/src/styles/partials/_forms.sass +9 -0
  191. data/default_configuration/base_app/frontend/src/styles/partials/_layout.sass +17 -0
  192. data/default_configuration/base_app/frontend/src/styles/partials/_navbar.sass +10 -0
  193. data/default_configuration/base_app/frontend/src/styles/partials/_typography.sass +18 -0
  194. data/default_configuration/base_app/frontend/src/styles/states/_errorFallback.sass +7 -0
  195. data/default_configuration/base_app/frontend/src/styles/states/_root_homepage.sass +8 -0
  196. data/default_configuration/base_app/frontend/test-help/xpath.js +9 -0
  197. data/default_configuration/base_app/frontend/test/app.js +24 -0
  198. data/default_configuration/base_app/frontend/test/auth/confirmations/confirmationsStates.js +46 -0
  199. data/default_configuration/base_app/frontend/test/auth/passwords/passwordsControllers.js +193 -0
  200. data/default_configuration/base_app/frontend/test/auth/passwords/passwordsStates.js +108 -0
  201. data/default_configuration/base_app/frontend/test/auth/registrations/registrationsControllers.js +117 -0
  202. data/default_configuration/base_app/frontend/test/auth/registrations/registrationsStates.js +64 -0
  203. data/default_configuration/base_app/frontend/test/auth/sessions/sessionsControllers.js +95 -0
  204. data/default_configuration/base_app/frontend/test/auth/sessions/sessionsStates.js +67 -0
  205. data/default_configuration/base_app/frontend/test/specHelper.js +33 -0
  206. data/default_configuration/base_app/frontend/test/support/mockDirective.js +13 -0
  207. data/default_configuration/base_app/frontend/test/support/stateResolveFn.js +3 -0
  208. data/default_configuration/base_app/frontend/test/support/testStates.js +20 -0
  209. data/default_configuration/base_app/frontend/tools.md +223 -0
  210. data/default_configuration/base_app/lib/capistrano/tasks/sidekiq.rake +218 -0
  211. data/default_configuration/base_app/static-app.ru +3 -0
  212. data/default_configuration/base_app/tmux-windows +68 -0
  213. data/default_configuration/base_app/tmux-windows.txt +53 -0
  214. data/lib/xing/cli.rb +8 -3
  215. data/lib/xing/cli/generators/new_project.rb +48 -13
  216. metadata +219 -7
@@ -0,0 +1,29 @@
1
+ json:
2
+ errors:
3
+ # The default format to use in full error messages.
4
+ format: "%{attribute} %{message}"
5
+
6
+ # The values :model, :attribute and :value are always available for interpolation
7
+ # The value :count is available when applicable. Can be used for pluralization.
8
+ messages:
9
+ inclusion: "inclusion"
10
+ exclusion: "exclusion"
11
+ invalid: "invalid"
12
+ confirmation: "confirmation"
13
+ accepted: "accepted"
14
+ empty: "empty"
15
+ blank: "required"
16
+ present: "must_be_blank"
17
+ too_long: "longer_than_%{count}"
18
+ too_short: "shorter_than_%{count}"
19
+ wrong_length: "wrong_length_%{count}"
20
+ not_a_number: "not_a_number"
21
+ not_an_integer: "not_an_integer"
22
+ greater_than: "greater_than_%{count}"
23
+ greater_than_or_equal_to: "greater_than_%{count}"
24
+ equal_to: "equal_to_%{count}"
25
+ less_than: "less_than_%{count}"
26
+ less_than_or_equal_to: "less_than_or_equal_to_%{count}"
27
+ other_than: "other_than_%{count}"
28
+ odd: "odd"
29
+ even: "even"
@@ -0,0 +1,33 @@
1
+ Rails.application.routes.draw do
2
+ require 'sidekiq/web'
3
+ mount Sidekiq::Web => '/sidekiq'
4
+
5
+ # Top fixed routes for the front-end
6
+ #get "/homepage", :to => 'pages#show', :url_slug => 'homepage', :as => :homepage
7
+
8
+ #get "pages/:url_slug", :to => 'pages#show', :as => :page
9
+ #resources :menus, :only => [ :show, :index, :update ]
10
+
11
+ # This should be the root route, but for the moment public/index.html
12
+ # overrides root route even with an accept header
13
+ resources :resources, :only => [:index], :controller => 'xing/controllers/root_resources'
14
+
15
+ #namespace :admin do
16
+ #resources :froala_images, :only => [:index, :create]
17
+ #post "/froala_images/delete", :to => 'froala_images#destroy'
18
+ #resources :froala_documents, :only => [:create]
19
+ #resources :pages, :param => :url_slug
20
+ #resources :menu_items
21
+ #resources :content_blocks
22
+
23
+ ##resources :blog_posts, :except => 'show'
24
+ #end
25
+
26
+ mount_devise_token_auth_for 'User', at: '/users', controllers: {
27
+ registrations: 'registrations',
28
+ confirmations: 'confirmations',
29
+ passwords: 'passwords'
30
+ }, :skip => [:omniauth_callbacks]
31
+
32
+
33
+ end
@@ -0,0 +1,22 @@
1
+ test: &test
2
+ secret_key_base: 76bb3aa2c6d22c757c679898fe36dd8e502e3c5e3cfeccacc6b31c5b331cb2dce5395ba96e99bf010ef4d7573043f7e3afec825af6af5bc2f9596c5ff20ff91e
3
+ smtp:
4
+ address: smtp.gmail.com
5
+ port: 587,
6
+ domain: some-cms-test.com
7
+ user_name: admin@lrdesign.com
8
+ password: xxxxxxxx
9
+ email:
10
+ from: admin@example.com
11
+ reply_to: admin@example.com
12
+ test: test@lrdesign.com
13
+ from_domain: example.com
14
+ snapshot_server:
15
+ url: https://www.notaserver.com
16
+ user: user
17
+ password: password
18
+ sitemap_base_url: http://localhost:3000/
19
+ asset_host: http://localhost:3000/
20
+
21
+ development:
22
+ <<: *test
@@ -0,0 +1,57 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 310e870c28dac892712d0d67fc9119c4a05ed236467c6409a4db2fe32158092df5e787d5f4a4f2fa05187083e512a5d20c3583a6bf1164ec63571235e72f3ed2
15
+ smtp:
16
+ address: smtp.gmail.com
17
+ port: 587,
18
+ domain: lrdesign.com
19
+ user_name: admin@lrdesign.com
20
+ password: xxxxxxxx
21
+ email:
22
+ from: admin@lrdesign.com
23
+ reply_to: admin@lrdesign.com
24
+ # Destination for emails in dev environment
25
+ # this should be left blank in production
26
+ test: test@lrdesign.com
27
+ from_domain: 'localhost:3000'
28
+ snapshot_server:
29
+ url: https://www.notaserver.com
30
+ user: user
31
+ password: password
32
+ sitemap_base_url: http://localhost:3000/
33
+ asset_host: http://localhost:3000/
34
+
35
+ test:
36
+ secret_key_base: 76bb3aa2c6d22c757c679898fe36dd8e502e3c5e3cfeccacc6b31c5b331cb2dce5395ba96e99bf010ef4d7573043f7e3afec825af6af5bc2f9596c5ff20ff91e
37
+ smtp:
38
+ address: smtp.gmail.com
39
+ port: 587
40
+ domain: eclipticenterprises.com
41
+ user_name: admin@lrdesign.com"
42
+ password: xxxxxxxx
43
+ email:
44
+ from: admin@example.com
45
+ reply_to: admin@example.com
46
+ from_domain: 'example.com'
47
+ snapshot_server:
48
+ url: https://www.notaserver.com
49
+ user: user
50
+ password: password
51
+ sitemap_base_url: http://localhost:3000/
52
+ asset_host: http://localhost:3000/
53
+
54
+ # Do not keep production secrets in the repository,
55
+ # instead read values from the environment.
56
+ production:
57
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,4 @@
1
+ development:
2
+ :concurrency: 2
3
+ test:
4
+ :concurrency: 2
@@ -0,0 +1,10 @@
1
+ namespace :db do
2
+ namespace :sample_data do
3
+ namespace :user do
4
+ task :wipe do
5
+ User.delete_all
6
+ end
7
+ end
8
+ task :wipe => 'user:wipe'
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Daley', :city => cities.first)
8
+ admin = User.where(:email => 'admin@xingframework.com').first_or_create!(
9
+ :email_confirmation => 'admin@xingframework.com',
10
+ :password => 'password',
11
+ :password_confirmation => 'password',
12
+ :uid => 'admin@xingframework.com',
13
+ :role_name => 'Admin')
14
+ admin.confirm
@@ -0,0 +1,15 @@
1
+ require 'xing/static'
2
+
3
+ module APP_MODULE
4
+ # The intention is to make Static::RackApp configurable via override.
5
+ # At the moment, this is not the case - if you need to configure, replace
6
+ # this implementation. N.b. however that the RackApp interface is slated to
7
+ # change in the near term, and the override may need to be revisited then.
8
+ class StaticApp < Xing::Static::RackApp
9
+ # The static app isn't always started with a Rails environment, so we can't
10
+ # use Rails.root for this.
11
+ def self.log_root
12
+ File.expand_path("../../log", __FILE__)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,6 @@
1
+ FactoryGirl.define do
2
+ factory :user_session do
3
+ login 'admin'
4
+ password 'wxyz'
5
+ end
6
+ end
@@ -0,0 +1,35 @@
1
+ FactoryGirl.define do
2
+
3
+ factory :raw_user, :class => User do
4
+ sequence :uid do |n| "uid #{n}" end
5
+ sequence(:email) { |nn| "user_#{nn}@example.com" }
6
+ email_confirmation { "#{email}"}
7
+ password 'password'
8
+ password_confirmation 'password'
9
+
10
+ #facebook_uid 1
11
+ sign_in_count 20
12
+ failed_attempts 0
13
+ last_request_at "2014-04-14 15:20:54"
14
+ current_sign_in_at "2014-04-14 15:20:54"
15
+ last_sign_in_at "2014-04-14 15:20:54"
16
+ current_sign_in_ip "10.0.0.1"
17
+ last_sign_in_ip "10.0.0.1"
18
+ end
19
+
20
+ trait :confirmed do
21
+ confirmed_at Time.now
22
+ end
23
+
24
+ factory :user, :parent => :raw_user, :traits => [:confirmed]
25
+
26
+ factory :unconfirmed_user, :parent => :raw_user
27
+ factory :confirmed_user, :parent => :user, :traits => [:confirmed]
28
+
29
+ factory :admin_user, :parent => :user, :traits => [:confirmed] do
30
+ role_name 'Admin'
31
+ end
32
+
33
+ factory :admin, :parent => :admin_user
34
+
35
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.steps "User Sends Reset Password", :js => true, :vcr => {} do
4
+ before :all do
5
+ @user = FactoryGirl.create(:confirmed_user)
6
+ end
7
+
8
+ perform_steps "visit login"
9
+
10
+ step "click forgot password" do
11
+ click_on("Forgot your password?")
12
+ end
13
+
14
+ step "enter email address" do
15
+ fill_in "Email", :with => @user.email
16
+ end
17
+
18
+ step "click send reset" do
19
+ click_on("Send password reset instructions")
20
+ end
21
+
22
+ step "should have the confirmation" do
23
+ expect(page).to have_content("Password reset email sent!")
24
+ end
25
+
26
+ step "should send the email" do
27
+ email = open_email(@user.email)
28
+ expect(email).to have_link("Change my password")
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.steps "User Signs Up", :js => true, :vcr => {} do
4
+ before :all do
5
+ @user = FactoryGirl.build(:user)
6
+ end
7
+
8
+ perform_steps "sign up with"
9
+
10
+ it "should have confirmation link" do
11
+ expect(page).to have_content("confirmation link")
12
+ end
13
+
14
+ it "should send email" do
15
+ expect(ActionMailer::Base.deliveries).to_not be_empty
16
+ end
17
+
18
+ it "should have link in email" do
19
+ email = open_email(@user.email)
20
+ expect(email).to have_link('Confirm my account')
21
+ end
22
+
23
+ step "confirm user" do
24
+ User.last.confirm
25
+ end
26
+
27
+ perform_steps "sign in with"
28
+
29
+ it "should have sign out" do
30
+ expect(page).to have_content("Sign Out")
31
+ end
32
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+ require 'cancan/matchers'
3
+
4
+ describe Role::Admin do
5
+ let :user do FactoryGirl.create(:admin) end
6
+
7
+ describe 'abilities' do
8
+ subject(:ability) { Ability.new(user) }
9
+
10
+ it{ expect(ability).to be_able_to :manage, User }
11
+ end
12
+ end
@@ -0,0 +1,48 @@
1
+ require 'spec_helper'
2
+
3
+ describe Role do
4
+ let :admin_user do FactoryGirl.create(:admin) end
5
+
6
+ describe "class methods" do
7
+ before do
8
+ admin_user
9
+ end
10
+
11
+ describe "for" do
12
+ context 'admin' do
13
+ subject(:role){Role.for(admin_user) }
14
+ it { is_expected.to be_a(Role::Admin) }
15
+ it { expect(role.user).to eq(admin_user) }
16
+ end
17
+ end
18
+
19
+ describe "find by scope" do
20
+
21
+ context 'admin' do
22
+ subject(:role){Role::Admin.users }
23
+ it { expect(role.count).to eq(2) }
24
+ it { expect(role.last).to eq(admin_user) }
25
+ end
26
+ end
27
+ end
28
+
29
+ describe "initialization and attachment" do
30
+
31
+ it "should attach a AdminRole to the researcher user" do
32
+ expect(admin_user.role).to be_a(Role::Admin)
33
+ end
34
+
35
+ it "should attach the user to the role" do
36
+
37
+ # Below should be expanded when future user types are added.
38
+ # I left it as an array of one on purpose. -ED
39
+ [ admin_user ].each do |user|
40
+ expect(user.role.user).to eq(user)
41
+ end
42
+ end
43
+
44
+ it "should return its role name" do
45
+ expect(admin_user.role.role_name).to eq('Admin')
46
+ end
47
+ end
48
+ end