Module: ControllerMacros

Defined in:
lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb

Instance Method Summary collapse

Instance Method Details

#login_adminObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 2

def 
  before(:all) do
    @admin = FactoryGirl.create(:admin_user)
  end
  
  before(:each) do
    sign_out :user
     @admin
  end
end

#login_defaultObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 13

def 
  before(:all) do
    @user = FactoryGirl.create(:default_user)
  end
  
  before(:each) do
    sign_out :user
     @user
  end
end

#login_moderatorObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 35

def 
  before(:all) do
    @user = FactoryGirl.create(:moderator_user)
  end
  
  before(:each) do
    sign_out :user
     @user
  end
end

#login_redactorObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 24

def 
  before(:all) do
    @user = FactoryGirl.create(:redactor_user)
  end
  
  before(:each) do
    sign_out :user
     @user
  end
end

#user_logoutObject



46
47
48
49
50
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 46

def user_logout
  before(:each) do
    sign_out :user
  end
end