diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-20 11:59:59 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-20 12:39:27 -0200 |
commit | 3d52e139b13ad077286f2f9f46b7e98f43ad9564 (patch) | |
tree | 22c70561b0f64851d938e44661aafeed3a2c80b2 /spec/services/merge_requests | |
parent | 408e010d65e7e2e2b64a694e12d44636d7d81dec (diff) | |
download | gitlab-ce-3d52e139b13ad077286f2f9f46b7e98f43ad9564.tar.gz |
Rename Tasks to Todos
Diffstat (limited to 'spec/services/merge_requests')
-rw-r--r-- | spec/services/merge_requests/close_service_spec.rb | 6 | ||||
-rw-r--r-- | spec/services/merge_requests/create_service_spec.rb | 16 | ||||
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 37 |
3 files changed, 31 insertions, 28 deletions
diff --git a/spec/services/merge_requests/close_service_spec.rb b/spec/services/merge_requests/close_service_spec.rb index 50227af7f2b..8443a00e70c 100644 --- a/spec/services/merge_requests/close_service_spec.rb +++ b/spec/services/merge_requests/close_service_spec.rb @@ -5,7 +5,7 @@ describe MergeRequests::CloseService, services: true do let(:user2) { create(:user) } let(:merge_request) { create(:merge_request, assignee: user2) } let(:project) { merge_request.project } - let!(:pending_task) { create(:task, :assigned, user: user, project: project, target: merge_request, author: user2) } + let!(:todo) { create(:todo, :assigned, user: user, project: project, target: merge_request, author: user2) } before do project.team << [user, :master] @@ -43,8 +43,8 @@ describe MergeRequests::CloseService, services: true do expect(note.note).to include 'Status changed to closed' end - it 'marks pending tasks as done' do - expect(pending_task.reload).to be_done + it 'marks todos as done' do + expect(todo.reload).to be_done end end end diff --git a/spec/services/merge_requests/create_service_spec.rb b/spec/services/merge_requests/create_service_spec.rb index 2e3c9f88369..120f4d6a669 100644 --- a/spec/services/merge_requests/create_service_spec.rb +++ b/spec/services/merge_requests/create_service_spec.rb @@ -34,13 +34,14 @@ describe MergeRequests::CreateService, services: true do expect(service).to have_received(:execute_hooks).with(@merge_request) end - it 'does not creates a pending task' do + it 'does not creates todos' do attributes = { project: project, - target: @merge_request + target_id: @merge_request.id, + target_type: @merge_request.class.name } - expect(Task.where(attributes).count).to be_zero + expect(Todo.where(attributes).count).to be_zero end context 'when merge request is assigned to someone' do @@ -56,17 +57,18 @@ describe MergeRequests::CreateService, services: true do it { expect(@merge_request.assignee).to eq assignee } - it 'creates a pending task for new assignee' do + it 'creates a todo for new assignee' do attributes = { project: project, author: user, user: assignee, - target: @merge_request, - action: Task::ASSIGNED, + target_id: @merge_request.id, + target_type: @merge_request.class.name, + action: Todo::ASSIGNED, state: :pending } - expect(Task.where(attributes).count).to eq 1 + expect(Todo.where(attributes).count).to eq 1 end end end diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index 6d70e8ec16a..99703c7a8ec 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -98,16 +98,16 @@ describe MergeRequests::UpdateService, services: true do end end - context 'task queue' do - let!(:pending_task) { create(:task, :assigned, user: user, project: project, target: merge_request, author: user2) } + context 'todos' do + let!(:pending_todo) { create(:todo, :assigned, user: user, project: project, target: merge_request, author: user2) } context 'when the title change' do before do update_merge_request({ title: 'New title' }) end - it 'marks pending tasks as done' do - expect(pending_task.reload).to be_done + it 'marks pending todos as done' do + expect(pending_todo.reload).to be_done end end @@ -116,8 +116,8 @@ describe MergeRequests::UpdateService, services: true do update_merge_request({ description: 'Also please fix' }) end - it 'marks pending tasks as done' do - expect(pending_task.reload).to be_done + it 'marks pending todos as done' do + expect(pending_todo.reload).to be_done end end @@ -126,21 +126,22 @@ describe MergeRequests::UpdateService, services: true do update_merge_request({ assignee: user2 }) end - it 'marks previous assignee pending tasks as done' do - expect(pending_task.reload).to be_done + it 'marks previous assignee pending todos as done' do + expect(pending_todo.reload).to be_done end - it 'creates a pending task for new assignee' do + it 'creates a pending todo for new assignee' do attributes = { project: project, author: user, user: user2, - target: merge_request, - action: Task::ASSIGNED, + target_id: merge_request.id, + target_type: merge_request.class.name, + action: Todo::ASSIGNED, state: :pending } - expect(Task.where(attributes).count).to eq 1 + expect(Todo.where(attributes).count).to eq 1 end end @@ -149,8 +150,8 @@ describe MergeRequests::UpdateService, services: true do update_merge_request({ milestone: create(:milestone) }) end - it 'marks pending tasks as done' do - expect(pending_task.reload).to be_done + it 'marks pending todos as done' do + expect(pending_todo.reload).to be_done end end @@ -159,8 +160,8 @@ describe MergeRequests::UpdateService, services: true do update_merge_request({ label_ids: [label.id] }) end - it 'marks pending tasks as done' do - expect(pending_task.reload).to be_done + it 'marks pending todos as done' do + expect(pending_todo.reload).to be_done end end @@ -169,8 +170,8 @@ describe MergeRequests::UpdateService, services: true do update_merge_request({ target_branch: 'target' }) end - it 'marks pending tasks as done' do - expect(pending_task.reload).to be_done + it 'marks pending todos as done' do + expect(pending_todo.reload).to be_done end end end |