require 'rails_helper'

RSpec.describe 'Admin dashboard', type: :feature do
  let(:user) { create :user }

  before do
    allow(Devise::LDAP::Adapter).to receive(:get_ldap_param)
      .with(user.cn, :admin).and_return(["true"])

    login_as user, :scope => :user
  end

  scenario 'View dashboard' do
    visit admin_root_path
    expect(page).to have_content('great power')
  end
end
