import Ember from 'ember'
const {run} = Ember
import {afterEach, beforeEach, describe, it} from 'mocha'
import {expect} from 'chai'
import startApp from '../helpers/start-app'

describe('Acceptance: Application', function () {
  let application

  beforeEach(function () {
    application = startApp()
  })

  afterEach(function () {
    run(application, 'destroy')
  })

  it('can visit /', function () {
    visit('/')

    andThen(function () {
      expect(currentPath()).to.equal('demo')
    })
  })
  it('can visit /palette', function () {
    visit('/palette')

    andThen(function () {
      expect(currentPath()).to.equal('palette')
    })
  })
  it('can visit /typography', function () {
    visit('/typography')

    andThen(function () {
      expect(currentPath()).to.equal('typography')
    })
  })
  it('can visit /icons', function () {
    visit('/icons')

    andThen(function () {
      expect(currentPath()).to.equal('icons')
    })
  })
  it('can visit /area', function () {
    visit('/area')

    andThen(function () {
      expect(currentPath()).to.equal('area')
    })
  })
  it('can visit /button', function () {
    visit('/button')

    andThen(function () {
      expect(currentPath()).to.equal('button')
    })
  })
  it('can visit /checkbox', function () {
    visit('/checkbox')

    andThen(function () {
      expect(currentPath()).to.equal('checkbox')
    })
  })
  it('can visit /field', function () {
    visit('/field')

    andThen(function () {
      expect(currentPath()).to.equal('field')
    })
  })
  it('can visit /password', function () {
    visit('/password')

    andThen(function () {
      expect(currentPath()).to.equal('password')
    })
  })
  it('can visit /layout', function () {
    visit('/layout')

    andThen(function () {
      expect(currentPath()).to.equal('layout')
    })
  })
  it('can visit /link', function () {
    visit('/link')

    andThen(function () {
      expect(currentPath()).to.equal('link.index')
    })
  })
})

@@ -1,50 +1,4 @@
-import Ember from 'ember'%0Aconst %7Brun%7D = Ember%0A
 impo
@@ -79,16 +79,64 @@
  'chai'%0A
+import destroyApp from '../helpers/destroy-app'%0A
 import s
@@ -337,11 +337,18 @@
     
-run
+destroyApp
 (app
@@ -359,145 +359,102 @@
 tion
-, 'destroy')%0A  %7D)%0A%0A  it('can visit /', function () %7B%0A    visit('/')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('demo
+)%0A  %7D)%0A%0A  describe('visit /', function () %7B%0A    beforeEach(function () %7B%0A      return visit('/
 ')%0A 
@@ -463,89 +463,38 @@
  %7D)%0A
+%0A
   
-%7D)%0A
   it('
-can visit /palette', function () %7B%0A    visit('/palette')%0A%0A    andThen(
+redirects to /demo', 
 func
@@ -545,15 +545,12 @@
 al('
-palette
+demo
 ')%0A 
@@ -564,1067 +564,441 @@
  %7D)%0A
+%0A
   
-it('can visit /typography', function () %7B%0A    visit('/typography')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('typography')%0A    %7D)%0A  %7D)%0A  it('can visit /icons', function () %7B%0A    visit('/
+;%5B%0A    'area',%0A    'button',%0A    'checkbox',%0A    'field',%0A    '
 icons'
-)%0A
+,
 %0A    
-andThen(function () %7B%0A      expect(currentPath()).to.equal('icons')%0A    %7D)%0A  %7D)%0A  it('can visit /area', function () %7B%0A    visit('/area')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('area')%0A    %7D)%0A  %7D)%0A  it('can visit /button', function () %7B%0A    visit('/button')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('button')%0A    %7D)%0A  %7D)%0A  it('can visit /checkbox', function () %7B%0A    visit('/checkbox')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('checkbox')%0A    %7D)%0A  %7D)%0A  it('can visit /field', function () %7B%0A    visit('/field')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('field')%0A    %7D)%0A  %7D)%0A  it('can visit /password', function () %7B%0A    visit('/password')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('password')%0A    %7D)%0A  %7D)%0A  it('can 
+'layout',%0A    'palette',%0A    'password',%0A    'typography'%0A  %5D%0A    .forEach((path) =%3E %7B%0A      describe(%60visit /$%7Bpath%7D%60, function () %7B%0A        beforeEach(function () %7B%0A          return visit(%60/$%7Bpath%7D%60)%0A        %7D)%0A%0A        it('does not redirect', function () %7B%0A          expect(currentPath()).to.equal(path)%0A        %7D)%0A      %7D)%0A    %7D)%0A%0A  describe('
 visit /l
 ayou
@@ -993,21 +993,19 @@
 visit /l
-ayout
+ink
 ', funct
@@ -1021,96 +1021,58 @@
     
-visit('/layout')%0A%0A    andThen(function () %7B%0A      expect(currentPath()).to.equal('layout
+beforeEach(function () %7B%0A      return visit('/link
 ')%0A 
@@ -1081,83 +1081,41 @@
  %7D)%0A
+%0A
   
-%7D)%0A
   it('
-can visit /link', function () %7B%0A    visit('/link')%0A%0A    andThen(
+renders correct route', 
 func

Improve acceptance test