Commit 04c1f740 authored by Giorgenes Gelatti's avatar Giorgenes Gelatti

Refactor package graphql specs

remove uneeded license specific context
parent d9983961
...@@ -28,42 +28,40 @@ RSpec.describe 'getting a package list for a project' do ...@@ -28,42 +28,40 @@ RSpec.describe 'getting a package list for a project' do
) )
end end
context 'without the need for a license' do context 'when user has access to the project' do
context 'when user has access to the project' do before do
before do project.add_reporter(current_user)
project.add_reporter(current_user) post_graphql(query, current_user: current_user)
post_graphql(query, current_user: current_user) end
end
it_behaves_like 'a working graphql query' it_behaves_like 'a working graphql query'
it 'returns packages successfully' do it 'returns packages successfully' do
expect(packages_data[0]['node']['name']).to eq package.name expect(packages_data[0]['node']['name']).to eq package.name
end
end end
end
context 'when the user does not have access to the project/packages' do context 'when the user does not have access to the project/packages' do
before do before do
post_graphql(query, current_user: current_user) post_graphql(query, current_user: current_user)
end end
it_behaves_like 'a working graphql query' it_behaves_like 'a working graphql query'
it 'returns nil' do it 'returns nil' do
expect(graphql_data['project']).to be_nil expect(graphql_data['project']).to be_nil
end
end end
end
context 'when the user is not autenthicated' do context 'when the user is not autenthicated' do
before do before do
post_graphql(query) post_graphql(query)
end end
it_behaves_like 'a working graphql query' it_behaves_like 'a working graphql query'
it 'returns nil' do it 'returns nil' do
expect(graphql_data['project']).to be_nil expect(graphql_data['project']).to be_nil
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment