anoubis 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/anoubis/application_controller.rb +18 -6
  3. data/app/controllers/anoubis/core/application_controller.rb +6 -6
  4. data/app/controllers/anoubis/core/data/actions.rb +15 -15
  5. data/app/controllers/anoubis/core/data/callbacks.rb +5 -5
  6. data/app/controllers/anoubis/core/data/convert.rb +33 -33
  7. data/app/controllers/anoubis/core/data/defaults.rb +8 -8
  8. data/app/controllers/anoubis/core/data/get.rb +14 -14
  9. data/app/controllers/anoubis/core/data/load.rb +3 -3
  10. data/app/controllers/anoubis/core/data/set.rb +2 -2
  11. data/app/controllers/anoubis/core/data/setup.rb +5 -5
  12. data/app/controllers/anoubis/core/data_controller.rb +10 -10
  13. data/app/controllers/anoubis/core/index/actions.rb +2 -2
  14. data/app/controllers/anoubis/core/index/callbacks.rb +1 -1
  15. data/app/controllers/anoubis/core/index_controller.rb +4 -4
  16. data/app/controllers/anoubis/etc/base.rb +16 -11
  17. data/app/controllers/anoubis/etc/data.rb +1 -1
  18. data/app/controllers/anoubis/etc/field.rb +10 -10
  19. data/app/controllers/anoubis/etc/field_options.rb +1 -1
  20. data/app/controllers/anoubis/etc/field_order.rb +1 -1
  21. data/app/controllers/anoubis/etc/filter.rb +2 -2
  22. data/app/controllers/anoubis/etc/menu.rb +2 -2
  23. data/app/controllers/anoubis/etc/model.rb +1 -1
  24. data/app/controllers/anoubis/etc/tab_item.rb +1 -1
  25. data/app/controllers/anoubis/etc.rb +1 -1
  26. data/app/controllers/anoubis/export.rb +1 -1
  27. data/app/controllers/anoubis/output/autocomplete.rb +1 -1
  28. data/app/controllers/anoubis/output/basic.rb +1 -1
  29. data/app/controllers/anoubis/output/data.rb +1 -1
  30. data/app/controllers/anoubis/output/delete.rb +1 -1
  31. data/app/controllers/anoubis/output/edit.rb +1 -1
  32. data/app/controllers/anoubis/output/frame.rb +5 -5
  33. data/app/controllers/anoubis/output/login.rb +1 -1
  34. data/app/controllers/anoubis/output/menu.rb +3 -3
  35. data/app/controllers/anoubis/output/update.rb +1 -1
  36. data/app/controllers/anoubis/sso/client/application_controller.rb +2 -2
  37. data/app/controllers/anoubis/sso/client/data/actions.rb +2 -2
  38. data/app/controllers/anoubis/sso/client/data/callbacks.rb +2 -2
  39. data/app/controllers/anoubis/sso/client/data/convert.rb +2 -2
  40. data/app/controllers/anoubis/sso/client/data/defaults.rb +2 -2
  41. data/app/controllers/anoubis/sso/client/data/get.rb +2 -2
  42. data/app/controllers/anoubis/sso/client/data/load.rb +6 -6
  43. data/app/controllers/anoubis/sso/client/data/set.rb +2 -2
  44. data/app/controllers/anoubis/sso/client/data/setup.rb +2 -2
  45. data/app/controllers/anoubis/sso/client/data_controller.rb +9 -9
  46. data/app/controllers/anoubis/sso/client/index/actions.rb +6 -6
  47. data/app/controllers/anoubis/sso/client/index/callbacks.rb +1 -1
  48. data/app/controllers/anoubis/sso/client/index_controller.rb +3 -3
  49. data/app/controllers/anoubis/sso/server/application_controller.rb +2 -2
  50. data/app/controllers/anoubis/sso/server/login_controller.rb +1 -1
  51. data/app/controllers/anoubis/sso/server/user_controller.rb +1 -1
  52. data/app/controllers/anoubis/tenant/application_controller.rb +4 -4
  53. data/app/controllers/anoubis/tenant/data/actions.rb +2 -2
  54. data/app/controllers/anoubis/tenant/data/callbacks.rb +2 -2
  55. data/app/controllers/anoubis/tenant/data/convert.rb +2 -2
  56. data/app/controllers/anoubis/tenant/data/defaults.rb +2 -2
  57. data/app/controllers/anoubis/tenant/data/get.rb +2 -2
  58. data/app/controllers/anoubis/tenant/data/load.rb +5 -5
  59. data/app/controllers/anoubis/tenant/data/set.rb +2 -2
  60. data/app/controllers/anoubis/tenant/data/setup.rb +2 -2
  61. data/app/controllers/anoubis/tenant/data_controller.rb +10 -10
  62. data/app/controllers/anoubis/tenant/index/actions.rb +15 -15
  63. data/app/controllers/anoubis/tenant/index/callbacks.rb +2 -2
  64. data/app/controllers/anoubis/tenant/index_controller.rb +4 -4
  65. data/app/controllers/anoubis/tenants_controller.rb +1 -1
  66. data/app/controllers/anoubis/users_controller.rb +1 -1
  67. data/app/models/anoubis/application_record.rb +2 -2
  68. data/app/models/anoubis/core/application_record.rb +3 -3
  69. data/app/models/anoubis/sso/client/group_menu.rb +6 -6
  70. data/app/models/anoubis/sso/client/menu.rb +8 -8
  71. data/app/models/anoubis/sso/client/user.rb +3 -3
  72. data/app/models/anoubis/sso/server/user.rb +1 -1
  73. data/app/models/anoubis/tenant/group_menu.rb +5 -5
  74. data/app/models/anoubis/tenant/menu.rb +13 -13
  75. data/app/models/anoubis/tenant/system.rb +5 -5
  76. data/app/models/anoubis/tenant/user.rb +4 -4
  77. data/app/services/anoubis/session_service.rb +1 -1
  78. data/config/locales/en.yml +17 -2
  79. data/config/locales/ru.yml +18 -3
  80. data/db/seeds.rb +30 -30
  81. data/lib/anoubis/version.rb +1 -1
  82. data/lib/anoubis.rb +1 -1
  83. data/spec/controllers/anoubis/index_controller_spec.rb +1 -1
  84. data/spec/dummy/log/development.log +0 -0
  85. data/spec/dummy/log/test.log +0 -0
  86. data/spec/dummy/tmp/development_secret.txt +1 -0
  87. data/spec/models/anoubis/group_locale_spec.rb +1 -1
  88. data/spec/models/anoubis/group_menu_spec.rb +6 -6
  89. data/spec/models/anoubis/group_spec.rb +3 -3
  90. data/spec/models/anoubis/menu_locale_spec.rb +1 -1
  91. data/spec/models/anoubis/menu_spec.rb +1 -1
  92. data/spec/models/anoubis/system_locale_spec.rb +1 -1
  93. data/spec/models/anoubis/system_menu_spec.rb +5 -5
  94. data/spec/models/anoubis/system_spec.rb +4 -4
  95. data/spec/models/anoubis/tenant_spec.rb +4 -4
  96. data/spec/models/anoubis/user_spec.rb +2 -2
  97. metadata +62 -56
@@ -1,6 +1,6 @@
1
1
  ##
2
2
  # Main User model. Stores inforation about all users that can access to the portal.
3
- class Anubis::Tenant::User < ApplicationRecord
3
+ class Anoubis::Tenant::User < ApplicationRecord
4
4
  # @!attribute patronymic
5
5
  # @return [String] user's patronymic
6
6
 
@@ -70,8 +70,8 @@ class Anubis::Tenant::User < ApplicationRecord
70
70
 
71
71
  # @!attribute tenant
72
72
  # @return [Tenant] the tenant that owns this user.
73
- belongs_to :tenant, class_name: 'Anubis::Tenant::Tenant'
74
- has_many :user_groups, class_name: 'Anubis::Tenant::UserGroup'
73
+ belongs_to :tenant, class_name: 'Anoubis::Tenant::Tenant'
74
+ has_many :user_groups, class_name: 'Anoubis::Tenant::UserGroup'
75
75
 
76
76
  has_one_attached :avatar
77
77
 
@@ -145,7 +145,7 @@ class Anubis::Tenant::User < ApplicationRecord
145
145
  throw(:abort, __method__)
146
146
  end
147
147
 
148
- Anubis::Tenant::UserGroup.where(user_id: self.id).delete_all
148
+ Anoubis::Tenant::UserGroup.where(user_id: self.id).delete_all
149
149
  end
150
150
 
151
151
  ##
@@ -1,4 +1,4 @@
1
- class Anubis::SessionService < Anubis::CoreService
1
+ class Anoubis::SessionService < Anoubis::CoreService
2
2
  def initialize
3
3
  super
4
4
  end
@@ -1,5 +1,4 @@
1
1
  en:
2
- success: Successful
3
2
  errors:
4
3
  no_api_version: API version not defined
5
4
  invalid_locale: Invalid locale
@@ -28,10 +27,26 @@ en:
28
27
  page_title: Users management
29
28
  short_title: Users
30
29
 
30
+
31
+
32
+
31
33
  anoubis:
34
+ all: All
35
+ success: Successful
36
+ error: Error
37
+ install:
38
+ menu:
39
+ dashboard:
40
+ title: Dashboard
41
+ page_title: Dashboad
42
+ short_title: Dashboard
43
+
44
+
45
+
46
+
32
47
  default_tab: Default
33
48
  default_tab_hint: This is default tab
34
- install:
49
+ install2:
35
50
  groups:
36
51
  admin: Administrators
37
52
  user: Users
@@ -1,6 +1,4 @@
1
1
  ru:
2
- all: Все
3
- success: Успешное завершение
4
2
  actions:
5
3
  edit: "Редактировать: %{title}"
6
4
  delete: "Удалить: %{title}"
@@ -32,7 +30,24 @@ ru:
32
30
  page_title: Управление пользователями
33
31
  short_title: Пользователи
34
32
 
33
+
34
+
35
+
36
+
37
+
35
38
  anoubis:
39
+ all: Все
40
+ success: Успешное завершение
41
+ error: Ошибка
42
+ install:
43
+ menu:
44
+ dashboard:
45
+ title: Дашборд
46
+ page_title: Дашборд
47
+ short_title: Дашборд
48
+
49
+
50
+
36
51
  core:
37
52
  success: Завершено корректно
38
53
  errors:
@@ -82,7 +97,7 @@ ru:
82
97
  - окт
83
98
  - ноя
84
99
  - дек
85
- install:
100
+ install2:
86
101
  groups:
87
102
  admin: Администраторы
88
103
  user: Пользователи
data/db/seeds.rb CHANGED
@@ -5,16 +5,16 @@ def create_tenant(params = {})
5
5
  return nil if !params.has_key? :ident
6
6
  return nil if !params.has_key? :title
7
7
 
8
- tenant = Anubis::Tenant::Tenant.find_or_create_by ident: params[:ident]
8
+ tenant = Anoubis::Tenant::Tenant.find_or_create_by ident: params[:ident]
9
9
  tenant.title = params[:title]
10
10
  if params.has_key? :default
11
11
  if params[:default]
12
- tenant.state = Anubis::Tenant::Tenant.states[:default]
12
+ tenant.state = Anoubis::Tenant::Tenant.states[:default]
13
13
  end
14
14
  end
15
15
  tenant.save
16
16
 
17
- Anubis::Tenant::TenantSystem.find_or_create_by tenant: tenant, system_id: 1
17
+ Anoubis::Tenant::TenantSystem.find_or_create_by tenant: tenant, system_id: 1
18
18
 
19
19
  return tenant
20
20
  end
@@ -31,7 +31,7 @@ def create_menu(params = {})
31
31
  prefix = 'install.menu.'+params[:mode].to_s
32
32
 
33
33
  if get_anubis_type == 'tenant'
34
- data = Anubis::Tenant::Menu.find_or_create_by(mode: params[:mode]) do |menu|
34
+ data = Anoubis::Tenant::Menu.find_or_create_by(mode: params[:mode]) do |menu|
35
35
  menu.action = params[:action]
36
36
  menu.menu = params[:parent] if params.key? :parent
37
37
  menu.page_size = params[:page_size] if params.key? :page_size
@@ -40,7 +40,7 @@ def create_menu(params = {})
40
40
 
41
41
  I18n.available_locales.each do |locale|
42
42
  I18n.locale = locale
43
- Anubis::Tenant::MenuLocale.find_or_create_by(menu_id: data.id, locale: Anubis::Tenant::MenuLocale.locales[locale.to_s.to_sym]) do |menu_locale|
43
+ Anoubis::Tenant::MenuLocale.find_or_create_by(menu_id: data.id, locale: Anoubis::Tenant::MenuLocale.locales[locale.to_s.to_sym]) do |menu_locale|
44
44
  menu_locale.title = I18n.t(prefix+'.title')
45
45
  menu_locale.page_title = I18n.t(prefix+'.page_title')
46
46
  menu_locale.short_title = I18n.t(prefix+'.short_title', default: [(prefix+'.title').to_sym])
@@ -50,10 +50,10 @@ def create_menu(params = {})
50
50
  if params.has_key?(:group) && params.has_key?(:system)
51
51
  if params[:system].is_a? Array
52
52
  params[:system].each do |system|
53
- Anubis::Tenant::SystemMenu.find_or_create_by system: system, menu: data
53
+ Anoubis::Tenant::SystemMenu.find_or_create_by system: system, menu: data
54
54
  end
55
55
  else
56
- Anubis::Tenant::SystemMenu.find_or_create_by system: params[:system], menu: data
56
+ Anoubis::Tenant::SystemMenu.find_or_create_by system: params[:system], menu: data
57
57
  end
58
58
 
59
59
  if params[:group].is_a? Array
@@ -67,7 +67,7 @@ def create_menu(params = {})
67
67
  end
68
68
 
69
69
  if get_anubis_type == 'sso-client'
70
- data = Anubis::Sso::Client::Menu.find_or_create_by(mode: params[:mode])
70
+ data = Anoubis::Sso::Client::Menu.find_or_create_by(mode: params[:mode])
71
71
 
72
72
  #puts data.to_json
73
73
 
@@ -117,11 +117,11 @@ def create_system(params = {})
117
117
  return nil if !params.has_key? :ident
118
118
  return nil if !params.has_key? :translate
119
119
 
120
- system = Anubis::Tenant::System.find_or_create_by ident: params[:ident]
120
+ system = Anoubis::Tenant::System.find_or_create_by ident: params[:ident]
121
121
  if system
122
122
  I18n.available_locales.each do |locale|
123
123
  I18n.locale = locale
124
- Anubis::Tenant::SystemLocale.find_or_create_by(system: system, locale: Anubis::Tenant::SystemLocale.locales[locale.to_s.to_sym]) do |system_locale|
124
+ Anoubis::Tenant::SystemLocale.find_or_create_by(system: system, locale: Anoubis::Tenant::SystemLocale.locales[locale.to_s.to_sym]) do |system_locale|
125
125
  system_locale.title = I18n.t(params[:translate])
126
126
  end
127
127
  end
@@ -130,10 +130,10 @@ def create_system(params = {})
130
130
  if params.has_key? :tenant
131
131
  if params[:tenant].is_a? Array
132
132
  params[:tenant].each do |tenant|
133
- Anubis::Tenant::TenantSystem.find_or_create_by tenant: tenant, system: system
133
+ Anoubis::Tenant::TenantSystem.find_or_create_by tenant: tenant, system: system
134
134
  end
135
135
  else
136
- Anubis::Tenant::TenantSystem.find_or_create_by tenant: params[:tenant], system: system
136
+ Anoubis::Tenant::TenantSystem.find_or_create_by tenant: params[:tenant], system: system
137
137
  end
138
138
  end
139
139
 
@@ -149,11 +149,11 @@ def create_group(params = {})
149
149
  if get_anubis_type == 'tenant'
150
150
  return nil if !params.has_key? :system
151
151
 
152
- group = Anubis::Tenant::Group.find_or_create_by ident: params[:ident], system: params[:system]
152
+ group = Anoubis::Tenant::Group.find_or_create_by ident: params[:ident], system: params[:system]
153
153
  if group
154
154
  I18n.available_locales.each do |locale|
155
155
  I18n.locale = locale
156
- Anubis::Tenant::GroupLocale.find_or_create_by(group: group, locale: Anubis::Tenant::GroupLocale.locales[locale.to_s.to_sym]) do |group_locale|
156
+ Anoubis::Tenant::GroupLocale.find_or_create_by(group: group, locale: Anoubis::Tenant::GroupLocale.locales[locale.to_s.to_sym]) do |group_locale|
157
157
  group_locale.title = I18n.t(params[:translate])
158
158
  end
159
159
  end
@@ -162,16 +162,16 @@ def create_group(params = {})
162
162
  if params.has_key? :user
163
163
  if params[:user].is_a? Array
164
164
  params[:user].each do |user|
165
- Anubis::Tenant::UserGroup.find_or_create_by group: group, user: user
165
+ Anoubis::Tenant::UserGroup.find_or_create_by group: group, user: user
166
166
  end
167
167
  else
168
- Anubis::Tenant::UserGroup.find_or_create_by group: group, user: params[:user]
168
+ Anoubis::Tenant::UserGroup.find_or_create_by group: group, user: params[:user]
169
169
  end
170
170
  end
171
171
  end
172
172
 
173
173
  if get_anubis_type == 'sso-client'
174
- group = Anubis::Sso::Client::Group.find_or_create_by ident: params[:ident]
174
+ group = Anoubis::Sso::Client::Group.find_or_create_by ident: params[:ident]
175
175
 
176
176
  if group
177
177
  I18n.available_locales.each do |locale|
@@ -192,8 +192,8 @@ def add_access_menu(params = {})
192
192
  params[:access] = 'read' if !params.has_key? :access
193
193
 
194
194
  if %w[tenant sso-client].include? get_anubis_type
195
- group_menu_model = Anubis::Tenant::GroupMenu if get_anubis_type == 'tenant'
196
- group_menu_model = Anubis::Sso::Client::GroupMenu if get_anubis_type == 'sso-client'
195
+ group_menu_model = Anoubis::Tenant::GroupMenu if get_anubis_type == 'tenant'
196
+ group_menu_model = Anoubis::Sso::Client::GroupMenu if get_anubis_type == 'sso-client'
197
197
 
198
198
  if params[:group].class == Array
199
199
  params[:group].each do |group|
@@ -227,40 +227,40 @@ end
227
227
  if get_anubis_type == 'tenant'
228
228
  ##
229
229
  # Create default system with id 1
230
- system = Anubis::Tenant::System.find_by_id(1)
230
+ system = Anoubis::Tenant::System.find_by_id(1)
231
231
  if !system
232
- system = Anubis::Tenant::System.create(id: 1)
232
+ system = Anoubis::Tenant::System.create(id: 1)
233
233
  end
234
234
  I18n.available_locales.each do |locale|
235
235
  I18n.locale = locale
236
- Anubis::Tenant::SystemLocale.find_or_create_by(system_id: system.id, locale: Anubis::Tenant::SystemLocale.locales[locale.to_s.to_sym]) do |system_locale|
236
+ Anoubis::Tenant::SystemLocale.find_or_create_by(system_id: system.id, locale: Anoubis::Tenant::SystemLocale.locales[locale.to_s.to_sym]) do |system_locale|
237
237
  system_locale.title = I18n.t('anubis.install.system_title')
238
238
  end
239
239
  end
240
240
 
241
241
  ##
242
242
  # Create default tenant with id 1
243
- tenant = Anubis::Tenant::Tenant.find_by_id(1)
244
- tenant = Anubis::Tenant::Tenant.create(id: 1, title: I18n.t('anubis.install.tenant_title'), state: Anubis::Tenant::Tenant.states[:default]) if !tenant
243
+ tenant = Anoubis::Tenant::Tenant.find_by_id(1)
244
+ tenant = Anoubis::Tenant::Tenant.create(id: 1, title: I18n.t('anubis.install.tenant_title'), state: Anoubis::Tenant::Tenant.states[:default]) if !tenant
245
245
 
246
- Anubis::Tenant::TenantSystem.find_or_create_by tenant: tenant, system: system
246
+ Anoubis::Tenant::TenantSystem.find_or_create_by tenant: tenant, system: system
247
247
 
248
248
  ##
249
249
  # Load Administrator group of Main System
250
- admin_group = Anubis::Tenant::Group.where(system: system, ident: 'admin').first
250
+ admin_group = Anoubis::Tenant::Group.where(system: system, ident: 'admin').first
251
251
  I18n.available_locales.each do |locale|
252
252
  I18n.locale = locale
253
- Anubis::Tenant::GroupLocale.find_or_create_by(group_id: admin_group.id, locale: Anubis::Tenant::GroupLocale.locales[locale.to_s.to_sym]) do |group_locale|
253
+ Anoubis::Tenant::GroupLocale.find_or_create_by(group_id: admin_group.id, locale: Anoubis::Tenant::GroupLocale.locales[locale.to_s.to_sym]) do |group_locale|
254
254
  group_locale.title = I18n.t('anubis.install.admins_group')
255
255
  end
256
256
  end
257
257
 
258
258
  ##
259
259
  # Create main administrator with id 1
260
- admin_user = Anubis::Tenant::User.find_by_id(1)
261
- admin_user = Anubis::Tenant::User.create(id: 1, email: 'admin@local.local', name: I18n.t('anubis.install.admin_name'), surname: I18n.t('anubis.install.admin_surname'), timezone: 'GMT', status: 0, tenant: tenant) if !admin_user
260
+ admin_user = Anoubis::Tenant::User.find_by_id(1)
261
+ admin_user = Anoubis::Tenant::User.create(id: 1, email: 'admin@local.local', name: I18n.t('anubis.install.admin_name'), surname: I18n.t('anubis.install.admin_surname'), timezone: 'GMT', status: 0, tenant: tenant) if !admin_user
262
262
 
263
- Anubis::Tenant::UserGroup.find_or_create_by(user_id: admin_user.id, group_id: admin_group.id)
263
+ Anoubis::Tenant::UserGroup.find_or_create_by(user_id: admin_user.id, group_id: admin_group.id)
264
264
 
265
265
  menu_0 = create_menu({ mode: 'anubis/admin', action: 'menu' })
266
266
  menu_1 = create_menu({ mode: 'anubis/tenants', action: 'data', parent: menu_0, system: system, group: admin_group, access: 'write' })
@@ -1,5 +1,5 @@
1
1
  module Anoubis
2
2
  ##
3
3
  # Anoubis current version
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
data/lib/anoubis.rb CHANGED
@@ -19,7 +19,7 @@ module Anoubis
19
19
  send :after_destroy, :manual_order_after_destroy
20
20
 
21
21
  self.manual_order_options = params if params.is_a?(Hash)
22
- include Anubis::HasManualOrder::LocalInstanceMethods
22
+ include Anoubis::HasManualOrder::LocalInstanceMethods
23
23
  end
24
24
  end
25
25
 
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe IndexController, type: :controller do
5
5
  render_views
6
6
 
File without changes
File without changes
@@ -0,0 +1 @@
1
+ b714976384f5d8e128e9d5c58df9222bcc4080b2f24285167f4ded45cac2aa0dbc2fdb53441fb6cd83176c54a5a98dbe0c4c7e02e85188f571fb930abe770dac
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe GroupLocale, type: :model do
5
5
  it "has short title" do
6
6
  expect(build_stubbed(:group_locale, title: 'T'*2)).to be_invalid
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe GroupMenu, type: :model do
5
5
  before(:all) do
6
6
  @system = create :system, ident: 'test'
@@ -21,7 +21,7 @@ module Anubis
21
21
 
22
22
  it "check created tree" do
23
23
  create :group_menu, group: @group, menu: @menu3
24
- expect(Anubis::GroupMenu.where(group: @group).count(:id)).to eq 3
24
+ expect(Anoubis::GroupMenu.where(group: @group).count(:id)).to eq 3
25
25
  end
26
26
 
27
27
  it "can destroy" do
@@ -32,16 +32,16 @@ module Anubis
32
32
 
33
33
  it "can destroy tree" do
34
34
  create :group_menu, group: @group, menu: @menu3
35
- Anubis::GroupMenu.where(group: @group, menu: @menu1).first.destroy
36
- expect(Anubis::GroupMenu.where(group: @group).count(:id)).to eq 0
35
+ Anoubis::GroupMenu.where(group: @group, menu: @menu1).first.destroy
36
+ expect(Anoubis::GroupMenu.where(group: @group).count(:id)).to eq 0
37
37
  end
38
38
 
39
39
  after(:all) do
40
- Anubis::SystemMenu.where(system: @system, menu: @menu1).first.destroy
40
+ Anoubis::SystemMenu.where(system: @system, menu: @menu1).first.destroy
41
41
  @menu3.destroy
42
42
  @menu2.destroy
43
43
  @menu1.destroy
44
- Anubis::Group.where(system_id: @system.id).each do |item|
44
+ Anoubis::Group.where(system_id: @system.id).each do |item|
45
45
  item.destroy
46
46
  end
47
47
  @system.destroy
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe Group, type: :model do
5
5
  it "is valid" do
6
6
  expect(build_stubbed(:group)).to be_valid
@@ -32,7 +32,7 @@ module Anubis
32
32
 
33
33
  it "can't change admin group ident" do
34
34
  system = create :system
35
- group = Anubis::Group.where(system: system, ident: 'admin').first
35
+ group = Anoubis::Group.where(system: system, ident: 'admin').first
36
36
  group.ident = 'tst'
37
37
  expect(group.save).to eq false
38
38
  end
@@ -44,7 +44,7 @@ module Anubis
44
44
  end
45
45
 
46
46
  it "can't destroy admin group of main system" do
47
- group = Anubis::Group.where(system_id: 1, ident: 'admin').first
47
+ group = Anoubis::Group.where(system_id: 1, ident: 'admin').first
48
48
  group.destroy
49
49
  expect(group.destroyed?).to eq false
50
50
  end
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe MenuLocale, type: :model do
5
5
  it "has short title" do
6
6
  expect(build_stubbed(:menu_locale, title: 'T'*2)).to be_invalid
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe Menu, type: :model do
5
5
  it "is valid" do
6
6
  expect(build_stubbed(:menu)).to be_valid
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe SystemLocale, type: :model do
5
5
  it "has short title" do
6
6
  expect(build_stubbed(:system_locale, title: 'T'*2)).to be_invalid
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe SystemMenu, type: :model do
5
5
  before(:all) do
6
6
  @system = create :system, ident: 'test'
@@ -20,7 +20,7 @@ module Anubis
20
20
 
21
21
  it "check created tree" do
22
22
  create :system_menu, system: @system, menu: @menu3
23
- expect(Anubis::SystemMenu.where(system: @system).count(:id)).to eq 3
23
+ expect(Anoubis::SystemMenu.where(system: @system).count(:id)).to eq 3
24
24
  end
25
25
 
26
26
  it "can destroy" do
@@ -31,8 +31,8 @@ module Anubis
31
31
 
32
32
  it "can destroy tree" do
33
33
  create :system_menu, system: @system, menu: @menu3
34
- Anubis::SystemMenu.where(system: @system, menu: @menu1).first.destroy
35
- expect(Anubis::SystemMenu.where(system: @system).count(:id)).to eq 0
34
+ Anoubis::SystemMenu.where(system: @system, menu: @menu1).first.destroy
35
+ expect(Anoubis::SystemMenu.where(system: @system).count(:id)).to eq 0
36
36
  end
37
37
 
38
38
  after(:all) do
@@ -40,7 +40,7 @@ module Anubis
40
40
  @menu2.destroy
41
41
  @menu1.destroy
42
42
  #@group.destroy
43
- Anubis::Group.where(system_id: @system.id).each do |item|
43
+ Anoubis::Group.where(system_id: @system.id).each do |item|
44
44
  item.destroy
45
45
  end
46
46
  @system.destroy
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe System, type: :model do
5
5
  it "is valid" do
6
6
  expect(build_stubbed(:system)).to be_valid
@@ -30,14 +30,14 @@ module Anubis
30
30
  end
31
31
 
32
32
  it "can't change main system ident" do
33
- system = Anubis::System.find(1)
33
+ system = Anoubis::System.find(1)
34
34
  system.ident = 'tst'
35
35
  expect(system.save).to eq false
36
36
  end
37
37
 
38
38
  it "can destroy" do
39
39
  system = create :system, ident: 'dst'
40
- Anubis::Group.where(system_id: system.id).each do |item|
40
+ Anoubis::Group.where(system_id: system.id).each do |item|
41
41
  item.destroy
42
42
  end
43
43
  system.destroy
@@ -45,7 +45,7 @@ module Anubis
45
45
  end
46
46
 
47
47
  it "can't destroy main system" do
48
- system = Anubis::System.find(1)
48
+ system = Anoubis::System.find(1)
49
49
  system.destroy
50
50
  expect(system.destroyed?).to eq false
51
51
  end
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe Tenant, type: :model do
5
5
  it "is valid" do
6
6
  expect(build_stubbed(:tenant)).to be_valid
@@ -44,14 +44,14 @@ module Anubis
44
44
  end
45
45
 
46
46
  it "can't change system tenant ident" do
47
- tenant = Anubis::Tenant.find(1)
47
+ tenant = Anoubis::Tenant.find(1)
48
48
  tenant.ident = 'tst'
49
49
  expect(tenant.save).to eq false
50
50
  end
51
51
 
52
52
  it "can destroy" do
53
53
  tenant = create :tenant, title: 'Destroy', ident: 'dst'
54
- Anubis::TenantSystem.where(tenant_id: tenant.id).each do |item|
54
+ Anoubis::TenantSystem.where(tenant_id: tenant.id).each do |item|
55
55
  item.destroy
56
56
  end
57
57
  tenant.destroy
@@ -59,7 +59,7 @@ module Anubis
59
59
  end
60
60
 
61
61
  it "can't destroy system tenant" do
62
- tenant = Anubis::Tenant.find(1)
62
+ tenant = Anoubis::Tenant.find(1)
63
63
  tenant.destroy
64
64
  expect(tenant.destroyed?).to eq false
65
65
  end
@@ -1,6 +1,6 @@
1
1
  require 'rails_helper'
2
2
 
3
- module Anubis
3
+ module Anoubis
4
4
  RSpec.describe User, type: :model do
5
5
  it "is valid" do
6
6
  expect(build_stubbed(:user)).to be_valid
@@ -49,7 +49,7 @@ module Anubis
49
49
  end
50
50
 
51
51
  it "can't destroy Main Administrator" do
52
- user = Anubis::User.find(1)
52
+ user = Anoubis::User.find(1)
53
53
  user.destroy
54
54
  expect(user.destroyed?).to eq false
55
55
  end