Sha256: 05017e817c6261f95528b60cd3f8375b0579ff618761ceb8e9ee7bce3da5e2c9
Contents?: true
Size: 906 Bytes
Versions: 22
Compression:
Stored size: 906 Bytes
Contents
module FeatureSignInHelper def sign_in(user = create(:user)) mock_omni_auth_google_oauth2( uid: user.uid, name: user.name, first_name: user.first_name, last_name: user.last_name, email: user.email, image: user.image, ) visit kuroko2_path click_on('Sign in with Google') end def mock_omni_auth_google_oauth2(options = {}) OmniAuth.config.mock_auth[:google_oauth2] = OmniAuth::AuthHash.new( uid: options[:uid] || 'john@example.org', info: { name: options[:name] || "John Doe", first_name: options[:first_name] || "John", last_name: options[:last_name] || "Doe", email: options[:email] || "john@example.org", image: options[:image] || "https://img.example.org/john.doe.png", }, credentials: { expires_at: options[:expires_at] || 1.month.since.to_i, } ) end end
Version data entries
22 entries across 22 versions & 1 rubygems