From f79b6af18a29f8ddececb9c64de5ff6d456d1d29 Mon Sep 17 00:00:00 2001 From: Jeremy <jeremy.benoist@gmail.com> Date: Sun, 25 Jan 2015 10:35:16 +0100 Subject: [PATCH] Fix HoundCI --- app/models/project_services/asana_service.rb | 25 +++++++++++++++----- spec/models/asana_service_spec.rb | 3 --- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/models/project_services/asana_service.rb b/app/models/project_services/asana_service.rb index 174d69ae3cd..db1e7a2b1cb 100644 --- a/app/models/project_services/asana_service.rb +++ b/app/models/project_services/asana_service.rb @@ -27,13 +27,16 @@ class AsanaService < Service end def help - 'This service adds commit messages as comments to Asana tasks. Once enabled, commit messages -are checked for Asana task URLs (for example, `https://app.asana.com/0/123456/987654`) or task IDs -starting with # (for example, `#987654`). Every task ID found will get the commit comment added to it. + 'This service adds commit messages as comments to Asana tasks. +Once enabled, commit messages are checked for Asana task URLs +(for example, `https://app.asana.com/0/123456/987654`) or task IDs +starting with # (for example, `#987654`). Every task ID found will +get the commit comment added to it. You can also close a task with a message containing: `fix #123456`. -You can find your Api Keys here: http://developer.asana.com/documentation/#api_keys' +You can find your Api Keys here: +http://developer.asana.com/documentation/#api_keys' end def to_param @@ -42,8 +45,18 @@ You can find your Api Keys here: http://developer.asana.com/documentation/#api_k def fields [ - { type: 'text', name: 'api_key', placeholder: 'User API token. User must have access to task, all comments will be attributed to this user.' }, - { type: 'text', name: 'restrict_to_branch', placeholder: 'Comma-separated list of branches which will be automatically inspected. Leave blank to include all branches.' } + { + type: 'text', + name: 'api_key', + placeholder: 'User API token. User must have access to task, +all comments will be attributed to this user.' + }, + { + type: 'text', + name: 'restrict_to_branch', + placeholder: 'Comma-separated list of branches which will be +automatically inspected. Leave blank to include all branches.' + } ] end diff --git a/spec/models/asana_service_spec.rb b/spec/models/asana_service_spec.rb index d5d3d6c7c1c..7cdf346db63 100644 --- a/spec/models/asana_service_spec.rb +++ b/spec/models/asana_service_spec.rb @@ -48,15 +48,12 @@ describe AsanaService, models: true do it 'should call Asana service to created a story' do Asana::Task.should_receive(:find).with('123456').once - # Asana::Task.should_receive(:create_story).with('pushed related to #123456').once @asana.check_commit('related to #123456', 'pushed') end it 'should call Asana service to created a story and close a task' do Asana::Task.should_receive(:find).with('456789').twice - # Asana::Task.should_receive(:create_story).with('pushed related to #456789').once - # Asana::Task.should_receive(:modify).with(completed: true).once @asana.check_commit('fix #456789', 'pushed') end -- GitLab