Skip to content

Commit

Permalink
cover the NOAUTH env in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mose committed Dec 28, 2017
1 parent f4bed13 commit ae0b2cf
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/meetbot_test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -319,23 +319,39 @@ describe 'meetbot module', ->
afterEach ->
room.robot.brain.data.meetbot = { }

context 'meet start', ->
context 'meet start new meeting', ->
beforeEach ->
@now = moment().utc().format('HH:mm')
hubot 'meet start', 'UXXXXXXXX'
hubot 'meet start new meeting', 'UXXXXXXXX'
it 'should deny permission to the user', ->
expect(hubotResponseCount()).to.eql 1
expect(hubotResponse())
.to.eq "You don't have permission to do that."

context 'normal user starts a new meeting in a NOAUTH environment', ->
beforeEach ->
process.env.MEETBOT_NOAUTH='y'
room.robot.brain.data.meetbot = { }
afterEach ->
room.robot.brain.data.meetbot = { }

context 'meet start new meeting', ->
beforeEach ->
@now = moment().utc().format('HH:mm')
hubot 'meet start new meeting', 'UXXXXXXXX'
it 'should deny permission to the user', ->
expect(hubotResponseCount()).to.eql 1
expect(hubotResponse())
.to.eq "Meeting `new meeting` is now open. All discussions will now be recorded."


context 'admin user starts a new meeting', ->
beforeEach ->
room.robot.brain.data.meetbot = { }
afterEach ->
room.robot.brain.data.meetbot = { }

context 'meet start', ->
context 'meet start new meeting', ->
beforeEach ->
@now = moment().utc().format('HH:mm')
hubot 'meet start new meeting', 'U00000000'
Expand Down

0 comments on commit ae0b2cf

Please sign in to comment.