Improve spec/lib/gitlab/git_access_snippet_spec spec

parent 65d333c0
...@@ -140,8 +140,6 @@ RSpec.describe Gitlab::GitAccessSnippet do ...@@ -140,8 +140,6 @@ RSpec.describe Gitlab::GitAccessSnippet do
end end
context 'when project is public but snippet feature is private' do context 'when project is public but snippet feature is private' do
let(:project) { create(:project, :public) }
before do before do
update_feature_access_level(project, :private) update_feature_access_level(project, :private)
end end
...@@ -151,7 +149,7 @@ RSpec.describe Gitlab::GitAccessSnippet do ...@@ -151,7 +149,7 @@ RSpec.describe Gitlab::GitAccessSnippet do
end end
context 'when project is not accessible' do context 'when project is not accessible' do
let(:project) { create(:project, :private) } let_it_be(:project) { create(:project, :private) }
[:anonymous, :non_member].each do |membership| [:anonymous, :non_member].each do |membership|
context membership.to_s do context membership.to_s do
...@@ -168,7 +166,7 @@ RSpec.describe Gitlab::GitAccessSnippet do ...@@ -168,7 +166,7 @@ RSpec.describe Gitlab::GitAccessSnippet do
end end
context 'when project is archived' do context 'when project is archived' do
let(:project) { create(:project, :public, :archived) } let_it_be(:project) { create(:project, :public, :archived) }
[:anonymous, :non_member].each do |membership| [:anonymous, :non_member].each do |membership|
context membership.to_s do context membership.to_s do
...@@ -214,7 +212,7 @@ RSpec.describe Gitlab::GitAccessSnippet do ...@@ -214,7 +212,7 @@ RSpec.describe Gitlab::GitAccessSnippet do
end end
context 'when snippet feature is disabled' do context 'when snippet feature is disabled' do
let(:project) { create(:project, :public, :snippets_disabled) } let_it_be(:project) { create(:project, :public, :snippets_disabled) }
[:anonymous, :non_member, :author, :admin].each do |membership| [:anonymous, :non_member, :author, :admin].each do |membership|
context membership.to_s do context membership.to_s do
...@@ -306,9 +304,9 @@ RSpec.describe Gitlab::GitAccessSnippet do ...@@ -306,9 +304,9 @@ RSpec.describe Gitlab::GitAccessSnippet do
end end
describe 'repository size restrictions' do describe 'repository size restrictions' do
let(:snippet) { create(:personal_snippet, :public, :repository) } let_it_be(:snippet) { create(:personal_snippet, :public, :repository) }
let(:actor) { snippet.author }
let(:actor) { snippet.author }
let(:oldrev) { TestEnv::BRANCH_SHA["snippet/single-file"] } let(:oldrev) { TestEnv::BRANCH_SHA["snippet/single-file"] }
let(:newrev) { TestEnv::BRANCH_SHA["snippet/edit-file"] } let(:newrev) { TestEnv::BRANCH_SHA["snippet/edit-file"] }
let(:ref) { "refs/heads/snippet/edit-file" } let(:ref) { "refs/heads/snippet/edit-file" }
......
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