diff options
author | Valery Sizov <valery@gitlab.com> | 2017-05-10 23:54:10 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2017-05-12 14:12:29 +0300 |
commit | e2a3a5095abd8c1fa57dd19e4ff693ae4021fde8 (patch) | |
tree | 435cd38964d20a0b1ad67b9dc02dcdbbe76d00c1 /spec/models/merge_request_spec.rb | |
parent | 92bf7dfcb040e3e035fc87b0a70461f891284c98 (diff) |
Move update_assignee_cache_counts to the service
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r-- | spec/models/merge_request_spec.rb | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index ef349530761..e8124c4cbe9 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -87,48 +87,6 @@ describe MergeRequest, models: true do end end - describe "before_save" do - describe "#update_cache_counts when a merge request is reassigned" do - let(:project) { create :project } - let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } - let(:assignee) { create :user } - - context "when previous assignee exists" do - before do - project.team << [assignee, :developer] - merge_request.update(assignee: assignee) - end - - it "updates cache counts for new assignee" do - user = create(:user) - - expect(user).to receive(:update_cache_counts) - - merge_request.update(assignee: user) - end - - it "updates cache counts for previous assignee" do - old_assignee = merge_request.assignee - allow(User).to receive(:find_by_id).with(old_assignee.id).and_return(old_assignee) - - expect(old_assignee).to receive(:update_cache_counts) - - merge_request.update(assignee: nil) - end - end - - context "when previous assignee does not exist" do - it "updates cache count for the new assignee" do - merge_request.update(assignee: nil) - - expect_any_instance_of(User).to receive(:update_cache_counts) - - merge_request.update(assignee: assignee) - end - end - end - end - describe '#card_attributes' do it 'includes the author name' do allow(subject).to receive(:author).and_return(double(name: 'Robert')) |