Add feature spec examples

With both logged in normal user and admin
This commit is contained in:
2020-11-18 10:10:31 +01:00
parent 3030d6f0f3
commit 1734b5c700
4 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
RSpec.describe 'Admin dashboard', type: :feature do
let(:user) { create :user }
before do
allow(user).to receive(:is_admin?).and_return(true)
login_as user, :scope => :user
end
scenario 'View dashboard' do
visit admin_root_path
expect(page).to have_content('Admin Panel')
end
end