diff --git a/app/models/project_services/asana_service.rb b/app/models/project_services/asana_service.rb index 174d69ae3cd82291dd5af0e0afe1867b0dbc33c5..db1e7a2b1cb24596de12b3e740c066e3d169351f 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 d5d3d6c7c1c377186d5b8de021e2f8c996cdcf39..7cdf346db63dfba5b5f699be4bacfbccb9054afa 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