Sha256: 3729dd4c9837cfb18e231c68cf115d4c2b0587ecfc0c06f95ad1c3d1a3cd9da8

Contents?: true

Size: 1.03 KB

Versions: 64

Compression:

Stored size: 1.03 KB

Contents

module ControllerMacros
  def login_admin
    before(:each) do
      @request.env["devise.mapping"] = Devise.mappings[:admin]
      sign_in Factory.create(:admin)
    end
  end

  def login_librarian
    before(:each) do
      @request.env["devise.mapping"] = Devise.mappings[:user]
      user = Factory.create(:librarian)
      sign_in user
    end
  end

  def login_user
    before(:each) do
      @request.env["devise.mapping"] = Devise.mappings[:user]
      user = Factory.create(:user)
      sign_in user
    end
  end

  def login_fixture_admin
    before(:each) do
      @request.env["devise.mapping"] = Devise.mappings[:admin]
      @user = users(:admin)
      sign_in @user
    end
  end

  def login_fixture_librarian
    before(:each) do
      @request.env["devise.mapping"] = Devise.mappings[:user]
      @user = users(:librarian1)
      sign_in @user
    end
  end

  def login_fixture_user
    before(:each) do
      @request.env["devise.mapping"] = Devise.mappings[:user]
      @user = users(:user1)
      sign_in @user
    end
  end
end

Version data entries

64 entries across 64 versions & 12 rubygems

Version Path
enju_circulation-0.0.21 spec/support/controller_macros.rb
enju_circulation-0.0.20 spec/support/controller_macros.rb
enju_circulation-0.0.19 spec/support/controller_macros.rb
enju_circulation-0.0.18 spec/support/controller_macros.rb
enju_circulation-0.0.17 spec/support/controller_macros.rb
enju_circulation-0.0.16 spec/support/controller_macros.rb
enju_subject-0.0.10 spec/support/controller_macros.rb
enju_question-0.0.10 spec/support/controller_macros.rb
enju_circulation-0.0.15 spec/support/controller_macros.rb
enju_bookmark-0.0.7 spec/support/controller_macros.rb
enju_subject-0.0.9 spec/support/controller_macros.rb
enju_message-0.0.13 spec/support/controller_macros.rb
enju_circulation-0.0.14 spec/support/controller_macros.rb
enju_purchase_request-0.0.6 spec/support/controller_macros.rb
enju_question-0.0.9 spec/support/controller_macros.rb
enju_bookmark-0.0.6 spec/support/controller_macros.rb
enju_message-0.0.12 spec/support/controller_macros.rb
enju_question-0.0.8 spec/support/controller_macros.rb
enju_event-0.0.9 spec/support/controller_macros.rb
enju_resource_merge-0.0.5 spec/support/controller_macros.rb