Add feature spec examples
With both logged in normal user and admin
This commit is contained in:
15
spec/features/admin/dashboard_spec.rb
Normal file
15
spec/features/admin/dashboard_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user