Sha256: 69466605efaeec1bf59e56c25b1c2e576828fe3c63ee4ac9e4b7c891b4328f2c

Contents?: true

Size: 366 Bytes

Versions: 2

Compression:

Stored size: 366 Bytes

Contents

module Controllers
  module SessionManagement
    def create_user_and_login
      user = create(:user)
      fake_login_with(user)
    end

    def build_user_and_login
      user = build(:user)
      fake_login_with(user)
    end

    def fake_login_with(user)
      allow(controller).to receive(:current_user).and_return(user)
      return user
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
exposition-0.0.5.7.pre.alpha spec/support/controllers/session_management.rb
exposition-0.0.5.6.pre.alpha spec/support/controllers/session_management.rb