Sha256: e6d302a2b07c8b8098ea36e4175feb21dffba9129319054e1aa8d46077262faa

Contents?: true

Size: 844 Bytes

Versions: 73

Compression:

Stored size: 844 Bytes

Contents

# encoding: utf-8
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

73 entries across 55 versions & 2 rubygems

Version Path
sunrise-cms-1.0.6 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.5 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.4 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.3 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.2 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.1 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.0 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.0.rc3 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.0.rc2 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.0.0.rc1 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.7.0.rc2 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.7.0.rc1 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.6.11 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.6.10 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.6.9 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.6.8 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.6.7 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-0.6.6 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
ab_admin-0.3.6 spec/support/controller_macros.rb
sunrise-cms-0.6.5 spec/tmp/spec/support/helpers/controller_macros.rb