Sha256: a3a7b2cb28c362c582b039791f35989a63b48a00e8efd98ea393e02a3e0c3ef8

Contents?: true

Size: 833 Bytes

Versions: 2

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

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

2 entries across 2 versions & 1 rubygems

Version Path
sunrise-cms-1.1.1 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb
sunrise-cms-1.1.0 lib/generators/sunrise/templates/spec/support/helpers/controller_macros.rb