diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-20 16:59:59 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-20 17:39:27 +0300 |
commit | 3d52e139b13ad077286f2f9f46b7e98f43ad9564 (patch) | |
tree | 22c70561b0f64851d938e44661aafeed3a2c80b2 /spec/services/issues | |
parent | 408e010d65e7e2e2b64a694e12d44636d7d81dec (diff) |
Rename Tasks to Todos
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/close_service_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 9 | ||||
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 33 |
3 files changed, 26 insertions, 24 deletions
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb index fdf0fd819b2..62b25709a5d 100644 --- a/spec/services/issues/close_service_spec.rb +++ b/spec/services/issues/close_service_spec.rb @@ -5,7 +5,7 @@ describe Issues::CloseService, services: true do let(:user2) { create(:user) } let(:issue) { create(:issue, assignee: user2) } let(:project) { issue.project } - let!(:pending_task) { create(:task, :assigned, user: user, project: project, target: issue, author: user2) } + let!(:todo) { create(:todo, :assigned, user: user, project: project, target: issue, author: user2) } before do project.team << [user, :master] @@ -34,8 +34,8 @@ describe Issues::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 @@ -47,7 +47,7 @@ describe Issues::CloseService, services: true do it { expect(@issue).to be_valid } it { expect(@issue).to be_opened } - it { expect(pending_task.reload).to be_pending } + it { expect(todo.reload).to be_pending } end end end diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index f3b66779987..5e7915db7e1 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -24,17 +24,18 @@ describe Issues::CreateService, services: true do it { expect(@issue.title).to eq('Awesome issue') } it { expect(@issue.assignee).to eq assignee } - it 'creates a pending task for new assignee' do + it 'creates a pending todo for new assignee' do attributes = { project: project, author: user, user: assignee, - target: @issue, - action: Task::ASSIGNED, + target_id: @issue.id, + target_type: @issue.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/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 5674b9f1e9b..e579e49dfa7 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -80,16 +80,16 @@ describe Issues::UpdateService, services: true do end end - context 'task queue' do - let!(:pending_task) { create(:task, :assigned, user: user, project: project, target: issue, author: user2) } + context 'todos' do + let!(:todo) { create(:todo, :assigned, user: user, project: project, target: issue, author: user2) } context 'when the title change' do before do update_issue({ title: 'New title' }) end - it 'marks pending tasks as done' do - expect(pending_task.reload.done?).to eq true + it 'marks pending todos as done' do + expect(todo.reload.done?).to eq true end end @@ -98,8 +98,8 @@ describe Issues::UpdateService, services: true do update_issue({ description: 'Also please fix' }) end - it 'marks pending tasks as done' do - expect(pending_task.reload.done?).to eq true + it 'marks todos as done' do + expect(todo.reload.done?).to eq true end end @@ -108,21 +108,22 @@ describe Issues::UpdateService, services: true do update_issue({ assignee: user2 }) end - it 'marks previous assignee pending tasks as done' do - expect(pending_task.reload.done?).to eq true + it 'marks previous assignee todos as done' do + expect(todo.reload.done?).to eq true end - it 'creates a pending task for new assignee' do + it 'creates a todo for new assignee' do attributes = { project: project, author: user, user: user2, - target: issue, - action: Task::ASSIGNED, + target_id: issue.id, + target_type: issue.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 @@ -131,8 +132,8 @@ describe Issues::UpdateService, services: true do update_issue({ milestone: create(:milestone) }) end - it 'marks pending tasks as done' do - expect(pending_task.reload.done?).to eq true + it 'marks todos as done' do + expect(todo.reload.done?).to eq true end end @@ -141,8 +142,8 @@ describe Issues::UpdateService, services: true do update_issue({ label_ids: [label.id] }) end - it 'marks pending tasks as done' do - expect(pending_task.reload.done?).to eq true + it 'marks todos as done' do + expect(todo.reload.done?).to eq true end end end |