forked from refinery/refinerycms
-
Notifications
You must be signed in to change notification settings - Fork 12
/
authentication.rb
30 lines (26 loc) · 1004 Bytes
/
authentication.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module Refinery
module Testing
module RequestMacros
module Authentication
def refinery_login_with(factory)
let!(:logged_in_user) { Factory.create(factory) }
before do
login_as logged_in_user, :scope => :refinery_user
end
end
def login_refinery_user
Refinery.deprecate(:login_refinery_user, :when => '2.2', :replacement => 'refinery_login_with :refinery_user')
refinery_login_with(:refinery_user)
end
def login_refinery_superuser
Refinery.deprecate(:login_refinery_superuser, :when => '2.2', :replacement => 'refinery_login_with :refinery_superuser')
refinery_login_with(:refinery_superuser)
end
def login_refinery_translator
Refinery.deprecate(:login_refinery_translator, :when => '2.2', :replacement => 'refinery_login_with :refinery_translator')
refinery_login_with(:refinery_translator)
end
end
end
end
end