Sha256: d69a10676161578e7a95bd629fbd4eedb551143031a9fbff3e1dd921a8ee69d8

Contents?: true

Size: 630 Bytes

Versions: 3

Compression:

Stored size: 630 Bytes

Contents

module ControllerMacros
  def login_admin
    before(:all) do
      @admin = Factory.create(:admin_user)
    end
    
    before(:each) do
      sign_out :user
      sign_in @admin
    end
  end
  
  def login_default
    before(:all) do
      @user = Factory.create(:default_user)
    end
    
    before(:each) do
      sign_out :user
      sign_in @user
    end
  end
  
  def login_redactor
    before(:all) do
      @user = Factory.create(:redactor_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

3 entries across 3 versions & 1 rubygems

Version Path
sunrise-core-0.2.2 spec/support/helpers/controller_macros.rb
sunrise-core-0.2.1 spec/support/helpers/controller_macros.rb
sunrise-core-0.2.0 spec/support/helpers/controller_macros.rb