Skip to content
Snippets Groups Projects
Commit 28904e57 authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

shared context to authenticate an admin user

parent 2b60f0d4
No related branches found
No related tags found
No related merge requests found
...@@ -14,3 +14,16 @@ RSpec.shared_context "authenticate_user", shared_context: :metadata do ...@@ -14,3 +14,16 @@ RSpec.shared_context "authenticate_user", shared_context: :metadata do
end end
end end
RSpec.shared_context "authenticate_user_admin", shared_context: :metadata do
let(:auth_client) { @auth_headers['client'] }
let(:uid) { @auth_headers['uid'] }
let(:access_token) { @auth_headers['access-token'] }
let(:role) { Role.all }
before do
@user = create(:user, roles: [role.find_by(name: 'admin')])
@auth_headers = @user.create_new_auth_token
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment