var db = require( '../../db' )
var chai = require( 'chai' )
chai.use( require( 'chai-as-promised' ) )
var expect = chai.expect

describe( 'making a post', function() {
    it( 'creates an account and creates a new post', function() {
        browser.get( 'http://localhost:3001' )
        element( by.css( 'nav .register' ) ).click()
        
        // fill out and submit login form
        element( by.model( 'username' ) ).sendKeys( 'drift' )
        element( by.model( 'password' ) ).sendKeys( 'pass' )
        element( by.css( 'form .btn' ) ).click()
        
        
        element( by.css( 'nav .posts' ) ).click()
        
        // submit a new post on the posts page
        var post = 'my test post' + Math.random()
        element( by.model( 'postBody' ) ).sendKeys( post )
        element( by.css( 'form .btn' ) ).click()
        browser.pause()
        
        // check that new post appears on the page
        element.all( by.css( 'ul.list-group li' ) ).first().getText()
            .to.eventually.contain( post )
        })
    })
    afterEach( function() {
        db.connection.db.dropDatabase()
    })
})
@@ -915,32 +915,40 @@
 the page%0A       
+ expect(
  element.all( by
@@ -961,18 +961,13 @@
 'ul.
-list-group
+posts
  li'
@@ -988,16 +988,18 @@
 etText()
+ )
 %0A       
@@ -1038,19 +1038,8 @@
 t )%0A
-        %7D)%0A
     

Fix protractor test