Commit 81bf3d8b authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'fj-fix-bug-snippet-repository-creation' into 'master'

Fix bug when snippet is created

See merge request gitlab-org/gitlab!25372
parents 75a095fe 299ccb95
...@@ -24,8 +24,8 @@ module Snippets ...@@ -24,8 +24,8 @@ module Snippets
spam_check(snippet, current_user) spam_check(snippet, current_user)
snippet_saved = snippet.with_transaction_returning_status do snippet_saved = snippet.with_transaction_returning_status do
if snippet.save && snippet.store_mentions! (snippet.save && snippet.store_mentions!).tap do |saved|
create_repository_for(snippet, current_user) create_repository_for(snippet, current_user) if saved
end end
end end
......
...@@ -164,7 +164,9 @@ describe Snippets::CreateService do ...@@ -164,7 +164,9 @@ describe Snippets::CreateService do
it 'does not create snippet repository' do it 'does not create snippet repository' do
stub_feature_flags(version_snippets: false) stub_feature_flags(version_snippets: false)
expect do
subject subject
end.to change(Snippet, :count).by(1)
expect(snippet.repository_exists?).to be_falsey expect(snippet.repository_exists?).to be_falsey
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