Module: ControllerMacros
- Defined in:
- lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
Instance Method Summary collapse
- #login_admin ⇒ Object
- #login_default ⇒ Object
- #login_moderator ⇒ Object
- #login_redactor ⇒ Object
- #user_logout ⇒ Object
Instance Method Details
#login_admin ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 2 def login_admin before(:all) do @admin = FactoryGirl.create(:admin_user) end before(:each) do sign_out :user sign_in @admin end end |
#login_default ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 13 def login_default before(:all) do @user = FactoryGirl.create(:default_user) end before(:each) do sign_out :user sign_in @user end end |
#login_moderator ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 35 def login_moderator before(:all) do @user = FactoryGirl.create(:moderator_user) end before(:each) do sign_out :user sign_in @user end end |
#login_redactor ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb', line 24 def login_redactor before(:all) do @user = FactoryGirl.create(:redactor_user) end before(:each) do sign_out :user sign_in @user end end |
#user_logout ⇒ Object
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 |