Commit b2f799c3 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'jh-refactor-issue-moved-tests' into 'master'

Remove database hits from Issue#moved? tests

See merge request gitlab-org/gitlab!27213
parents 3c2cdc9a e0ac704a
...@@ -313,19 +313,16 @@ describe Issue do ...@@ -313,19 +313,16 @@ describe Issue do
end end
describe '#moved?' do describe '#moved?' do
let(:issue) { create(:issue) } context 'when issue has not been moved' do
subject { build_stubbed(:issue) }
subject { issue.moved? }
context 'issue not moved' do it { is_expected.not_to be_moved }
it { is_expected.to eq false }
end end
context 'issue already moved' do context 'when issue has already been moved' do
let(:moved_to_issue) { create(:issue) } subject { build_stubbed(:issue, moved_to: build_stubbed(:issue)) }
let(:issue) { create(:issue, moved_to: moved_to_issue) }
it { is_expected.to eq true } it { is_expected.to be_moved }
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