refinerycms-authentication 2.0.10 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/refinery/admin/users_controller.rb +82 -54
  3. data/app/controllers/refinery/passwords_controller.rb +1 -1
  4. data/app/controllers/refinery/users_controller.rb +1 -1
  5. data/app/models/refinery/user.rb +28 -9
  6. data/app/views/refinery/admin/users/_actions.html.erb +3 -0
  7. data/app/views/refinery/admin/users/_form.html.erb +6 -4
  8. data/app/views/refinery/admin/users/_records.html.erb +7 -0
  9. data/app/views/refinery/passwords/edit.html.erb +1 -1
  10. data/app/views/refinery/users/new.html.erb +1 -1
  11. data/config/locales/bg.yml +1 -1
  12. data/config/locales/cs.yml +3 -3
  13. data/config/locales/da.yml +1 -1
  14. data/config/locales/de.yml +1 -1
  15. data/config/locales/el.yml +1 -1
  16. data/config/locales/en.yml +3 -2
  17. data/config/locales/es.yml +1 -1
  18. data/config/locales/fi.yml +1 -1
  19. data/config/locales/fr.yml +1 -1
  20. data/config/locales/hu.yml +72 -0
  21. data/config/locales/it.yml +1 -1
  22. data/config/locales/ja.yml +1 -1
  23. data/config/locales/ko.yml +2 -2
  24. data/config/locales/lt.yml +1 -1
  25. data/config/locales/lv.yml +1 -1
  26. data/config/locales/nb.yml +1 -1
  27. data/config/locales/nl.yml +37 -35
  28. data/config/locales/pl.yml +7 -3
  29. data/config/locales/pt-BR.yml +1 -1
  30. data/config/locales/pt.yml +72 -0
  31. data/config/locales/rs.yml +1 -1
  32. data/config/locales/ru.yml +1 -1
  33. data/config/locales/sk.yml +9 -9
  34. data/config/locales/sl.yml +1 -1
  35. data/config/locales/sv.yml +1 -1
  36. data/config/locales/tr.yml +72 -0
  37. data/config/locales/uk.yml +98 -0
  38. data/config/locales/vi.yml +1 -1
  39. data/config/locales/zh-CN.yml +5 -5
  40. data/config/locales/zh-TW.yml +1 -1
  41. data/config/routes.rb +9 -11
  42. data/db/migrate/20120301234455_add_slug_to_refinery_users.rb +7 -0
  43. data/lib/refinery/authenticated_system.rb +1 -1
  44. data/lib/refinery/authentication.rb +1 -0
  45. data/lib/refinery/authentication/devise.rb +0 -7
  46. data/lib/refinery/authentication/engine.rb +3 -4
  47. data/refinerycms-authentication.gemspec +4 -4
  48. data/spec/controllers/refinery/admin/users_controller_spec.rb +14 -5
  49. data/spec/factories/user.rb +2 -2
  50. data/spec/{requests → features}/refinery/admin/users_spec.rb +10 -10
  51. data/spec/{requests → features}/refinery/passwords_spec.rb +1 -1
  52. data/spec/{requests → features}/refinery/sessions_spec.rb +12 -11
  53. data/spec/models/refinery/user_spec.rb +57 -10
  54. metadata +29 -18
@@ -8,7 +8,7 @@ sl:
8
8
  delete: Odstrani uporabnika
9
9
  edit: Uredi uporabnika
10
10
  update:
11
- cannot_remove_user_plugin_from_current_user: "Ne morete odstraniti vstavka 'Uporabniki' iz trenutno prijavljenega računa."
11
+ lockout_prevented: "Ne morete odstraniti vstavka 'Uporabniki' iz trenutno prijavljenega računa."
12
12
  form:
13
13
  blank_password_keeps_current: V kolikor ne boste vnesli gesla bo ostalo obstoječe
14
14
  enable_all: omogoči vse
@@ -9,7 +9,7 @@ sv:
9
9
  delete: Ta bort den här användaren för alltid
10
10
  edit: Redigera den här användaren
11
11
  update:
12
- cannot_remove_user_plugin_from_current_user: Du kan inte ta bort insticksprogrammet 'Användare' från det konto som är inloggat.
12
+ lockout_prevented: Du kan inte ta bort insticksprogrammet 'Användare' från det konto som är inloggat.
13
13
  form:
14
14
  blank_password_keeps_current: Lämna blankt för att behålla nuvarande lösenord
15
15
  plugin_access: Åtkomst för plugin
@@ -0,0 +1,72 @@
1
+ tr:
2
+ refinery:
3
+ plugins:
4
+ refinery_users:
5
+ title: Kullanicilar
6
+ description: Kullanicilari Yonet
7
+ admin:
8
+ users:
9
+ delete: Bu kullaniciyi sonsuza dek sil!
10
+ edit: Bu kullaniciyi guncelle
11
+ update:
12
+ lockout_prevented: Su an bagli oldugun hesaptan 'Kullanicilar' adli eklentiyi silemezsin.
13
+ form:
14
+ blank_password_keeps_current: Parolayi bos birakirsan mevcut parolani korursun.
15
+ plugin_access: Eklenti Erisimi
16
+ role_access: Rol Erisimi
17
+ enable_all: Tumunu kullanima ac
18
+ actions:
19
+ create_new_user: Yeni bir kullanici ekle
20
+ user:
21
+ email_user: Bu kullaniciyi e-posta'la
22
+ preview: '(%{who}) eklendi %{created_at}'
23
+ sessions:
24
+ new:
25
+ hello_please_sign_in: Merhaba! Lutfen giris yapin.
26
+ sign_in: Giris Yap
27
+ forgot_password: Parolami Unuttum
28
+ user_mailer:
29
+ reset_notification:
30
+ subject: Parola sifirlamaya baglanti olustur
31
+ reset_request_received_for: " %{username} Parola degisikligi icin talepte bulundu "
32
+ visit_this_url: Yeni bir Parola secmek icin URL'yi ziyaret edin
33
+ remain_same_if_no_action: Herhangi bir harekette bulunmazsaniz parolaniz degismeyecektir
34
+ users:
35
+ new:
36
+ fill_form: Asagidaki detaylari doldurunuz ki sizi baslatalim
37
+ sign_up: Uye Kayit
38
+ create:
39
+ welcome: 'Refinery alanina hosgeldiniz, %{who}'
40
+ forgot:
41
+ email_address: E-posta Adresi
42
+ enter_email_address: Lutfen hesabiniz icin E-posta Adresinizi girin.
43
+ reset_password: Parolayi Sifirla
44
+ blank_email: Herhangi bir e-posta adresi girmediniz
45
+ email_not_associated_with_account_html: "Uzgunum, '%{email}' adli postayla iliskili herhangi bir hesap bulunamadi.<br />Dogru bir e-posta adresi girdiginizden emin misin?"
46
+ email_reset_sent: Sifrenizi sifirlamak icin e-posta gonderilmistir.
47
+ password_encryption: Sifreni sifirlamak zorundasin cunku Refinery nin sifreleme metodundaki degisikliklerden daha guclu bir sifreleme metodu kayitlandi.
48
+ reset:
49
+ code_invalid: "Uzgunum, sifre sifirlama zaman asimina ugradi yada hatali. Eger tarayiciniza kopyalama ya da yapistir calismiyorsa sayfayi yenileyin"
50
+ successful: "Parola sifirlama basariyle yapildi. %{email}'"
51
+ pick_new_password_for: " %{email} icin yeni bir parola belirleyin"
52
+ reset_password: Parolayi sifirla
53
+ roles:
54
+ superuser: Sistem Yoneticisi
55
+ refinery: Refinery
56
+ devise:
57
+ failure:
58
+ unauthenticated: Devam edebilmek icin giris yapmak zorundasiniz
59
+ invalid: "Uzgunum, kullanici adiniz yada parolaniz hatali."
60
+ sessions:
61
+ signed_in: Giris basariyla yapildi
62
+ activerecord:
63
+ models:
64
+ refinery/user: kullanici
65
+ attributes:
66
+ refinery/user:
67
+ login: Kullanici adi yada e-posta adresi
68
+ username: kullanici adi
69
+ password: parola
70
+ password_confirmation: Parola Dogrulama
71
+ email: E-posta
72
+ remember_me: Beni Hatirla
@@ -0,0 +1,98 @@
1
+ uk:
2
+ refinery:
3
+ plugins:
4
+ refinery_users:
5
+ title: Користувачі
6
+ description: Управління користувачами
7
+ article: masculine
8
+ admin:
9
+ users:
10
+ delete: Видалити цього користувача назавжди
11
+ edit: Редагувати цього користувача
12
+ update:
13
+ lockout_prevented: "Не можна відключити модуль «Користувачі» у самого себе."
14
+ form:
15
+ blank_password_keeps_current: 'Залиште поле порожнім, якщо не хочете змінити пароль'
16
+ plugin_access: Доступ до плагінів
17
+ role_access: Ролі
18
+ enable_all: увімкнути все
19
+ actions:
20
+ create_new_user: Створити нового користувача
21
+ user:
22
+ email_user: Написати ел. листа цьому користувачу
23
+ preview: '(%{who}) створений %{created_at}'
24
+ sessions:
25
+ new:
26
+ hello_please_sign_in: 'Увійдіть, будь ласка.'
27
+ sign_in: Увійти
28
+ forgot_password: Я забув свій пароль
29
+ users:
30
+ new:
31
+ fill_form: Заповніть дані нижче.
32
+ sign_up: Зареєструватися
33
+ create:
34
+ welcome: 'Ласкаво просимо до Refinery, %{who}'
35
+ forgot:
36
+ email_address: Ел. пошта
37
+ enter_email_address: 'Введіть, будь ласка, адресу електронної пошти вашого облікового запису.'
38
+ reset_password: Скинути пароль
39
+ blank_email: Ви не ввели адресу електронної пошти
40
+ email_not_associated_with_account_html: "%{email} не належить жодному обліковому.<br/>Ви впевнені, що ввели правильну адресу електронної пошти?"
41
+ email_reset_sent: Вам вислано електронного листа з посиланням для скидання пароля.
42
+ password_encryption: 'У Refinery змінилися алгоритми шифрування пароля для ще більш надійного зберігання, тому вам потрібно заново його встановити.'
43
+ reset:
44
+ code_invalid: "Код для скидання пароля завершився, або невірний. Спробуйте скопіювати і вставити адресу з листа в адресний рядок браузера або заново почати процес відновлення."
45
+ successful: "Пароль успішно змінено для %{email}"
46
+ pick_new_password_for: "Введіть новий пароль для %{email}"
47
+ reset_password: Змінити пароль
48
+ user_mailer:
49
+ reset_notification:
50
+ subject: Посилання для скидання пароля
51
+ reset_request_received_for: "Одержаний запит на скидання пароля для %{username}"
52
+ visit_this_url: Для введення нового пароля перейдіть за цим посиланням
53
+ remain_same_if_no_action: Ви також можете проігнорувати цей лист. У цьому випадку пароль не буде змінено.
54
+ devise:
55
+ failure:
56
+ unauthenticated: "Вам необхідно увійти в систему або зареєструватися."
57
+ unconfirmed: "Ви повинні підтвердити ваш обліковий запис."
58
+ locked: "Ваш обліковий запис заблокований."
59
+ invalid: "Неправильна адреса ел. пошти або пароль."
60
+ invalid_token: "Неправильний ключ аутентифікації."
61
+ timeout: "Ваш сеанс закінчився. Будь ласка, увійдіть в систему знову."
62
+ inactive: "Ваш обліковий запис ще не активовано."
63
+ sessions:
64
+ signed_in: "Вхід у систему виконаний."
65
+ signed_out: "Вихід з системи виконаний."
66
+ passwords:
67
+ send_instructions: "Протягом декількох хвилин ви отримаєте e-mail з інструкціями щодо відновлення вашого паролю."
68
+ updated: "Ваш пароль змінено. Тепер ви увійшли в систему."
69
+ confirmations:
70
+ send_instructions: "Протягом декількох хвилин ви отримаєте e-mail з інструкціями щодо підтвердження вашого профілю."
71
+ confirmed: "Ваш обліковий запис підтверджено. Тепер ви увійшли в систему."
72
+ registrations:
73
+ signed_up: "Ласкаво просимо! Ви успішно зареєструвалися. Протягом декількох хвилин ви отримаєте e-mail з інструкціями щодо підтвердження вашого профілю."
74
+ updated: "Ваш обліковий запис змінено."
75
+ destroyed: "До побачення! Ваш обліковий запис видалено. Сподіваємося знову побачити вас."
76
+ unlocks:
77
+ send_instructions: "Протягом декількох хвилин ви отримаєте листа з інструкціями щодо розблокуванню вашого профілю."
78
+ unlocked: "Ваш обліковий запис розблоковано. Тепер ви увійшли в систему."
79
+ mailer:
80
+ confirmation_instructions:
81
+ subject: "Інструкції щодо підтвердження облікового запису"
82
+ reset_password_instructions:
83
+ subject: "Інструкції щодо відновлення пароля"
84
+ unlock_instructions:
85
+ subject: "Інструкції щодо розблокування облікового запису"
86
+ sessions:
87
+ signed_in: 'Ви увійшли.'
88
+ activerecord:
89
+ models:
90
+ refinery/user: користувач
91
+ attributes:
92
+ refinery/user:
93
+ login: Ім'я або ел. пошта користувача
94
+ username: Ім'я користувача
95
+ email: Ел. пошта
96
+ password: Пароль
97
+ password_confirmation: Підтвердження пароля
98
+ remember_me: Запам'ятати мене
@@ -9,7 +9,7 @@ vi:
9
9
  delete: Xoá vĩnh viễn người dùng này
10
10
  edit: Chỉnh sửa người dùng này
11
11
  update:
12
- cannot_remove_user_plugin_from_current_user: Bạn không thể xoá 'Users' plugin bằng tài khoản bạn đang đăng nhập.
12
+ lockout_prevented: Bạn không thể xoá 'Users' plugin bằng tài khoản bạn đang đăng nhập.
13
13
  form:
14
14
  blank_password_keeps_current: Bỏ trống mật khẩu để giữ nguyên mật khẩu đang sử dụng
15
15
  plugin_access: Truy cập plugin
@@ -9,7 +9,7 @@ zh-CN:
9
9
  delete: 永久删除此用户
10
10
  edit: 编辑此用户
11
11
  update:
12
- cannot_remove_user_plugin_from_current_user: 您当前登录所使用的帐号无法移除‘用户’插件.
12
+ lockout_prevented: 您当前登录所使用的帐号无法移除‘用户’插件.
13
13
  form:
14
14
  blank_password_keeps_current: 保留密码框为空以保持原有密码
15
15
  plugin_access: 插件
@@ -37,8 +37,8 @@ zh-CN:
37
37
  reset_password: 重置密码
38
38
  blank_email: 您没有输入邮件地址.
39
39
  email_not_associated_with_account_html: "对不起, '%{email}' 并没有关联到任何的帐号.<br />您确认输入了正确的邮件地址?"
40
- email_reset_sent: 一封包含有重置密码连接的邮件已经发送到您的邮箱.
41
- password_encryption: '由于密码加密算法改变了以保障Refinery用户帐号的安全, 您需要重置您的密码. '
40
+ email_reset_sent: 一封包含有重置密码链接的邮件已经发送到您的邮箱.
41
+ password_encryption: '请重置您的密码. (为了更好的安全性,Refinery 改进了加密算法, 您需要重置密码使之生效)'
42
42
  reset:
43
43
  code_invalid: "我们很抱歉, 但这个重置号已经过期或者不可用, 如果您遇到问题的话请试着从您的邮件中复制粘贴里面的URL到您的浏览器中以便重新进入密码修改流程."
44
44
  successful: "'%{email}' 密码重置成功"
@@ -46,7 +46,7 @@ zh-CN:
46
46
  reset_password: 重置密码
47
47
  user_mailer:
48
48
  reset_notification:
49
- subject: 密码重置的连接
49
+ subject: 密码重置的链接
50
50
  reset_request_received_for: "请求收%{username}到重置密码"
51
51
  visit_this_url: 浏览此URL去选择一个新密码
52
52
  remain_same_if_no_action: '如果你不进行操作, 你的密码将维持不变'
@@ -55,7 +55,7 @@ zh-CN:
55
55
  refinery: Refinery
56
56
  devise:
57
57
  failure:
58
- unauthenticated: 您须要先登录以便继续.
58
+ unauthenticated: 您尚未登录.
59
59
  invalid: "对不起, 您的用户名或密码不正确."
60
60
  sessions:
61
61
  signed_in: 登录成功.
@@ -9,7 +9,7 @@ zh-TW:
9
9
  delete: 永遠移除這位使用者
10
10
  edit: 編輯這位使用者
11
11
  update:
12
- cannot_remove_user_plugin_from_current_user: 您無法從目前登入的帳號移除 '使用者' 插件.
12
+ lockout_prevented: 您無法從目前登入的帳號移除 '使用者' 插件.
13
13
  form:
14
14
  blank_password_keeps_current: 密碼處空白可維持現在的密碼
15
15
  plugin_access: 插件存取權限
data/config/routes.rb CHANGED
@@ -1,15 +1,9 @@
1
- Refinery::Core::Engine.routes.append do
2
- namespace :admin, :path => 'refinery' do
3
- resources :users, :except => :show
4
- end
5
- end
6
-
7
1
  Refinery::Core::Engine.routes.draw do
8
2
  begin
9
3
  require 'devise'
10
4
  devise_for :refinery_user,
11
5
  :class_name => 'Refinery::User',
12
- :path => 'refinery/users',
6
+ :path => "#{Refinery::Core.backend_route}/users",
13
7
  :controllers => { :registrations => 'refinery/users' },
14
8
  :skip => [:registrations],
15
9
  :path_names => { :sign_out => 'logout',
@@ -18,10 +12,10 @@ Refinery::Core::Engine.routes.draw do
18
12
 
19
13
  # Override Devise's other routes for convenience methods.
20
14
  devise_scope :refinery_user do
21
- get '/refinery/login', :to => "sessions#new", :as => :new_refinery_user_session
22
- get '/refinery/logout', :to => "sessions#destroy", :as => :destroy_refinery_user_session
23
- get '/refinery/users/register' => 'users#new', :as => :new_refinery_user_registration
24
- post '/refinery/users/register' => 'users#create', :as => :refinery_user_registration
15
+ get "/#{Refinery::Core.backend_route}/login", :to => "sessions#new", :as => :login
16
+ get "/#{Refinery::Core.backend_route}/logout", :to => "sessions#destroy", :as => :logout
17
+ get "/#{Refinery::Core.backend_route}/users/register" => 'users#new', :as => :signup
18
+ post "/#{Refinery::Core.backend_route}/users/register" => 'users#create', :as => :signup
25
19
  end
26
20
  rescue RuntimeError => exc
27
21
  if exc.message =~ /ORM/
@@ -35,4 +29,8 @@ Refinery::Core::Engine.routes.draw do
35
29
  raise exc
36
30
  end
37
31
  end
32
+
33
+ namespace :admin, :path => Refinery::Core.backend_route do
34
+ resources :users, :except => :show
35
+ end
38
36
  end
@@ -0,0 +1,7 @@
1
+ class AddSlugToRefineryUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :refinery_users, :slug, :string
4
+ add_index :refinery_users, :slug
5
+
6
+ end
7
+ end
@@ -4,7 +4,7 @@ module Refinery
4
4
  #
5
5
  # We can return to this location by calling #redirect_back_or_default.
6
6
  def store_location
7
- session[:return_to] = request.fullpath.sub("//", "/")
7
+ session[:return_to] = request.fullpath
8
8
  end
9
9
 
10
10
  # Clear and return the stored location
@@ -1,4 +1,5 @@
1
1
  require 'refinerycms-core'
2
+ require 'action_mailer'
2
3
  require 'devise'
3
4
  require 'friendly_id'
4
5
 
@@ -11,9 +11,6 @@ Devise.setup do |config|
11
11
  # Configure the class responsible to send e-mails.
12
12
  # config.mailer = "Devise::Mailer"
13
13
 
14
- # Automatically apply schema changes in tableless databases
15
- config.apply_schema = false
16
-
17
14
  # ==> ORM configuration
18
15
  # Load and configure the ORM. Supports :active_record (default) and
19
16
  # :mongoid (bson_ext recommended) by default. Other ORMs may be
@@ -117,10 +114,6 @@ Devise.setup do |config|
117
114
  # If true, extends the user's remember period when remembered via cookie.
118
115
  # config.extend_remember_period = false
119
116
 
120
- # If true, uses the password salt as remember token. This should be turned
121
- # to false if you are not using database authenticatable.
122
- config.use_salt_as_remember_token = true
123
-
124
117
  # Options to be passed to the created cookie. For instance, you can set
125
118
  # :secure => true in order to force SSL only cookies.
126
119
  # config.cookie_options = {}
@@ -1,7 +1,7 @@
1
1
  module Refinery
2
2
  module Authentication
3
3
  class Engine < ::Rails::Engine
4
- include Refinery::Engine
4
+ extend Refinery::Engine
5
5
 
6
6
  isolate_namespace Refinery
7
7
  engine_name :refinery_authentication
@@ -12,7 +12,6 @@ module Refinery
12
12
  Refinery::Plugin.register do |plugin|
13
13
  plugin.pathname = root
14
14
  plugin.name = 'refinery_users'
15
- plugin.version = %q{2.0.0}
16
15
  plugin.menu_match = %r{refinery/users$}
17
16
  plugin.activity = {
18
17
  :class_name => :'refinery/user',
@@ -23,8 +22,8 @@ module Refinery
23
22
  end
24
23
 
25
24
  before_inclusion do
26
- [Refinery::ApplicationController, Refinery::AdminController, ::ApplicationHelper].each do |c|
27
- c.send :include, Refinery::AuthenticatedSystem
25
+ [Refinery::AdminController, ::ApplicationController].each do |c|
26
+ Refinery.include_once(c, Refinery::AuthenticatedSystem)
28
27
  end
29
28
  end
30
29
 
@@ -1,8 +1,8 @@
1
1
  # Encoding: UTF-8
2
- $:.push File.expand_path('../../core/lib', __FILE__)
3
- require 'refinery/version'
2
+ require File.expand_path('../../core/lib/refinery/version', __FILE__)
4
3
 
5
4
  version = Refinery::Version.to_s
5
+ rails_version = ['>= 3.1.3', '< 3.3']
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
21
21
  s.test_files = `git ls-files -- spec/*`.split("\n")
22
22
 
23
23
  s.add_dependency 'refinerycms-core', version
24
- s.add_dependency 'devise', '~> 2.0.5'
25
- s.add_dependency 'orm_adapter', '~> 0.0.7'
24
+ s.add_dependency 'actionmailer', rails_version
25
+ s.add_dependency 'devise', '~> 2.2.3'
26
26
  end
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Refinery::Admin::UsersController do
4
- login_refinery_superuser
4
+ refinery_login_with_factory :refinery_superuser
5
5
 
6
6
  shared_examples_for "new, create, update, edit and update actions" do
7
7
  it "loads roles" do
@@ -53,7 +53,7 @@ describe Refinery::Admin::UsersController do
53
53
 
54
54
  describe "#edit" do
55
55
  it "renders the edit template" do
56
- get :edit, :id => refinery_superuser.id
56
+ get :edit, :id => logged_in_user.id
57
57
  response.should be_success
58
58
  response.should render_template("refinery/admin/users/edit")
59
59
  end
@@ -62,13 +62,22 @@ describe Refinery::Admin::UsersController do
62
62
  end
63
63
 
64
64
  describe "#update" do
65
+ let(:additional_user) { FactoryGirl.create :refinery_user }
65
66
  it "updates a user" do
66
- user = FactoryGirl.create(:refinery_user)
67
- Refinery::User.should_receive(:find).at_least(1).times{ user }
68
- put "update", :id => user.id.to_s, :user => {}
67
+ Refinery::User.should_receive(:find).at_least(1).times{ additional_user }
68
+ put "update", :id => additional_user.id.to_s, :user => {}
69
69
  response.should be_redirect
70
70
  end
71
71
 
72
+ context "when specifying plugins" do
73
+ it "won't allow to remove 'Users' plugin from self" do
74
+ Refinery::User.should_receive(:find).at_least(1).times{ logged_in_user }
75
+ put "update", :id => logged_in_user.id.to_s, :user => {:plugins => ["some plugin"]}
76
+
77
+ flash[:error].should eq("You cannot remove the 'Users' plugin from the currently logged in account.")
78
+ end
79
+ end
80
+
72
81
  it_should_behave_like "new, create, update, edit and update actions"
73
82
  end
74
83
  end
@@ -17,7 +17,7 @@ FactoryGirl.define do
17
17
  factory :refinery_user, :parent => :user do
18
18
  roles { [ ::Refinery::Role[:refinery] ] }
19
19
 
20
- after_create do |user|
20
+ after(:create) do |user|
21
21
  ::Refinery::Plugins.registered.each_with_index do |plugin, index|
22
22
  user.plugins.create(:name => plugin.name, :position => index)
23
23
  end
@@ -31,7 +31,7 @@ FactoryGirl.define do
31
31
  factory :refinery_translator, :parent => :user do
32
32
  roles { [ ::Refinery::Role[:refinery], ::Refinery::Role[:translator] ] }
33
33
 
34
- after_create do |user|
34
+ after(:create) do |user|
35
35
  user.plugins.create(:name => 'refinery_pages', :position => 0)
36
36
  end
37
37
  end