Sha256: ddc66595ce0faf2d613576fa0b2461c167f66a36896f345e6b611b8ec686272b

Contents?: true

Size: 826 Bytes

Versions: 26

Compression:

Stored size: 826 Bytes

Contents

module ControllerMacros
  def login_admin
    before(:all) do
      @admin = FactoryGirl.create(:admin_user)
    end
    
    before(:each) do
      sign_out :user
      sign_in @admin
    end
  end
  
  def login_default
    before(:all) do
      @user = FactoryGirl.create(:default_user)
    end
    
    before(:each) do
      sign_out :user
      sign_in @user
    end
  end
  
  def login_redactor
    before(:all) do
      @user = FactoryGirl.create(:redactor_user)
    end
    
    before(:each) do
      sign_out :user
      sign_in @user
    end
  end
  
  def login_moderator
    before(:all) do
      @user = FactoryGirl.create(:moderator_user)
    end
    
    before(:each) do
      sign_out :user
      sign_in @user
    end
  end
  
  def user_logout
    before(:each) do
      sign_out :user
    end
  end
end

Version data entries

26 entries across 23 versions & 3 rubygems

Version Path
ab_admin-0.7.0 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.6.1 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.6.0 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.5.0 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.4.0 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.3.6 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.3.5 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.3.4 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.3.3 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.3.2 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.3.1 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.3.0 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.2.3 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.2.2 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.2.1 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.2.0 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.1.2 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.1.1 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
ab_admin-0.1.0 lib/generators/ab_admin/install/templates/spec/support/controller_macros.rb
sunrise-cms-0.3.0.rc lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb