Sha256: 6010271b8db0e5cb4d80070a88f0d6bcabea5c78d5871a7773a16b239a7b44fe

Contents?: true

Size: 872 Bytes

Versions: 2

Compression:

Stored size: 872 Bytes

Contents

# frozen_string_literal: true

module ControllerHelpers
  def sign_in
    @account = Spina::Account.create name: 'My Website', preferences: {theme: 'default'}
    @user = Spina::User.create name: 'admin', email: 'admin@example.com', password: 'password', admin: true
    request.session[:spina_user_id] = @user.id
  end
end

module FeatureHelpers
  def sign_in
    @account = Spina::Account.create name: 'My Website', preferences: {theme: 'default'}
    @user = Spina::User.create name: 'admin', email: 'admin@example.com', password: 'password', admin: true
    visit '/admin/login'
    fill_in :email, with: @user.email
    fill_in :password, with: 'password'
    click_button 'Login'
    expect(page).to have_content("Pages")
  end
end

RSpec.configure do |config|
  config.include ControllerHelpers, type: :controller
  config.include FeatureHelpers, type: :system
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spina-admin-conferences-blog-0.3.1 spec/support/controller_helpers.rb
spina-admin-conferences-blog-0.2.0 spec/support/controller_helpers.rb