Commit d79758af authored by Sean McGivern's avatar Sean McGivern

Merge branch 'pass-fake-diff-refs-by-building-a-commit' into 'master'

Refactor Diff Note tests to support factories parent strategy

See merge request gitlab-org/gitlab!41690
parents d26e2828 a2d99ba4
...@@ -44,7 +44,7 @@ RSpec.describe 'Adding a DiffNote' do ...@@ -44,7 +44,7 @@ RSpec.describe 'Adding a DiffNote' do
it_behaves_like 'a Note mutation when there are active record validation errors', model: DiffNote it_behaves_like 'a Note mutation when there are active record validation errors', model: DiffNote
context do context do
let(:diff_refs) { build(:merge_request).diff_refs } # Allow fake diff refs so arguments are valid let(:diff_refs) { build(:commit).diff_refs } # Allow fake diff refs so arguments are valid
it_behaves_like 'a Note mutation when the given resource id is not for a Noteable' it_behaves_like 'a Note mutation when the given resource id is not for a Noteable'
end end
......
...@@ -47,7 +47,7 @@ RSpec.describe 'Adding an image DiffNote' do ...@@ -47,7 +47,7 @@ RSpec.describe 'Adding an image DiffNote' do
it_behaves_like 'a Note mutation when there are active record validation errors', model: DiffNote it_behaves_like 'a Note mutation when there are active record validation errors', model: DiffNote
context do context do
let(:diff_refs) { build(:merge_request).diff_refs } # Allow fake diff refs so arguments are valid let(:diff_refs) { build(:commit).diff_refs } # Allow fake diff refs so arguments are valid
it_behaves_like 'a Note mutation when the given resource id is not for a Noteable' it_behaves_like 'a Note mutation when the given resource id is not for a Noteable'
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