closeheat
Version:
Static Website Hosting with CMS without touching your code.
117 lines (96 loc) • 2.87 kB
text/coffeescript
expect = require('chai').expect
command = require './helpers/command'
TestApi = require './helpers/test_api'
assertStdout = require './helpers/assert_stdout'
TestConfig = require './helpers/test_config'
Config = require '../src/config'
TestGit = require './helpers/test_git'
gracefulUnauthorized =
"""
You need to log in for that.
Type closeheat login to do it swiftly.
"""
describe 'graceful when user cli is not authorized', ->
before (done) ->
TestGit.init().then ->
TestGit.addRemote().then ->
done()
after ->
it 'list', (done) ->
res.status(401).send
type: 'user-unauthorized'
message: 'Unauthorized'
command('list').then (stdout) ->
assertStdout stdout,
"""
- Getting information about your websites.
#{gracefulUnauthorized}
"""
done()
it 'clone', (done) ->
res.status(401).send
type: 'user-unauthorized'
message: 'Unauthorized'
command('clone example-slug').then (stdout) ->
assertStdout stdout,
"""
- Getting website information for example-slug.
#{gracefulUnauthorized}
"""
done()
describe 'log', ->
it 'slug unauthorized', (done) ->
res.status(401).send
type: 'user-unauthorized'
message: 'Unauthorized'
command('log').then (stdout) ->
assertStdout stdout,
"""
#{gracefulUnauthorized}
"""
done()
it 'builds unauthorized', (done) ->
res.send slug: 'example-slug'
res.status(401).send
type: 'user-unauthorized'
message: 'Unauthorized'
command('log').then (stdout) ->
assertStdout stdout,
"""
#{gracefulUnauthorized}
"""
done()
it 'open', (done) ->
res.status(401).send
type: 'user-unauthorized'
message: 'Unauthorized'
command('open').then (stdout) ->
assertStdout stdout,
"""
#{gracefulUnauthorized}
"""
done()
describe 'deploy', ->
it 'slug unauthorized', (done) ->
res.status(401).send
type: 'user-unauthorized'
message: 'Unauthorized'
command('publish').then (stdout) ->
assertStdout stdout,
"""
#{gracefulUnauthorized}
"""
done()