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
end
describe '#moved?' do
let(:issue) { create(:issue) }
subject { issue.moved? }
context 'when issue has not been moved' do
subject { build_stubbed(:issue) }
context 'issue not moved' do
it { is_expected.to eq false }
it { is_expected.not_to be_moved }
end
context 'issue already moved' do
let(:moved_to_issue) { create(:issue) }
let(:issue) { create(:issue, moved_to: moved_to_issue) }
context 'when issue has already been moved' do
subject { build_stubbed(:issue, moved_to: build_stubbed(:issue)) }
it { is_expected.to eq true }
it { is_expected.to be_moved }
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