Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #39 from m3brown/circular-hell
Browse files Browse the repository at this point in the history
Address import issue between gh and moirai workers
  • Loading branch information
Ooblioob committed Jul 28, 2015
2 parents e55ff73 + 23a607f commit 03953aa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/workers/gh.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/workers/moirai.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions spec/workers/moiraiSpec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe 'handleAddData', () ->
this.event = {data: {publicKeys: ['key']}}
this.user = {name: 'user_name'}

xit 'calls get_all_team_roles_for_user', (done) ->
it 'calls get_all_team_roles_for_user', (done) ->
handleAddData = moirai.handlers.user['d+']
handleAddData(this.event, this.user).then((resp) ->
expect(teams.get_all_team_roles_for_user.calls.length).toEqual(1)
Expand All @@ -223,7 +223,7 @@ describe 'handleAddData', () ->
done()
).catch(onError)

xit 'calls setTeamKeys', (done) ->
it 'calls setTeamKeys', (done) ->
handleAddData = moirai.handlers.user['d+']
handleAddData(this.event, this.user).then((resp) ->
expect(moirai.testing.setTeamKeys.calls.length).toEqual(2)
Expand Down
2 changes: 1 addition & 1 deletion src/workers/gh.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ users = require('../api/users')
auth = require('../validation').auth
git = require('./gh_client')
Promise = require('pantheon-helpers').promise
teams_api = require('../api/teams')

gh = {}

Expand Down Expand Up @@ -107,6 +106,7 @@ handle_create_team = (event, team) ->
)

get_gh_team_ids = (user) ->
teams_api = require('../api/teams')
teams_api.get_all_team_roles_for_user(user.name).then((team_roles) ->
gh_team_ids = team_roles.map((team_role) ->
return get_gh_team_id(team_role.team, user, team_role.role)
Expand Down
2 changes: 1 addition & 1 deletion src/workers/moirai.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
_ = require('underscore')
users = require('../api/users')
teams = require('../api/teams')
auth = require('../validation').auth
Promise = require('pantheon-helpers/lib/promise')
conf = require('../config')
Expand Down Expand Up @@ -69,6 +68,7 @@ handleAddCluster = (event, team) ->
handleAddData = (event, user) ->
# look at the event, see if one of the keys in the event is publicKeys
if event.data.publicKeys?
teams = require('../api/teams')
return teams.get_all_team_roles_for_user(user.name).then((teamList) ->
teamPromises = teamList.map((teamHash) ->
team = teamHash.team
Expand Down

0 comments on commit 03953aa

Please sign in to comment.