 
       context 'when I fill in the input box and press enter', ->
         before (done) ->
-          browser.fill '#header h2 input', randomname, ->
+          browser.fill '#title input', randomname, ->
             browser.evaluate """
               var e = jQuery.Event("keypress")
               e.which = 13
               e.keyCode = 13
-              $('#header h2 input').trigger(e)
+              $('#title input').trigger(e)
             """
             browser.wait done
 
         it 'hides the input box and shows the title', ->
-          @input = browser.query '#header h2 input'
-          @a = browser.query '#header h2 a'
+          @input = browser.query '#title input'
+          @a = browser.query '#title .editable'
           $(@a).is(':visible').should.be.true
           $(@input).is(':visible').should.be.false
 
         it 'has updated the title', (done) ->
-          @a = browser.query '#header h2 a'
+          @a = browser.query '#title .editable'
           $(@a).text().should.equal randomname
           done()
 

describe 'Dataset', ->
  randomname = "New favourite number is #{Math.random()}"
  browser = new Browser()

  before (done) ->
    browser.visit login_url, done

  before (done) ->
    browser.fill '#username', 'ickletest'
    browser.fill '#password', 'toottoot'
    browser.pressButton '#login', done

  context 'when I click on the newdataset dataset', ->
    before (done) ->
        link = browser.query('#datasets .50c84caed1f25c8211000003')
        browser.fire 'click', link, done

    it 'takes me to the highrise dataset page', ->
      result = browser.location.href


    context 'when I click the title', ->
      before (done) ->
        @input = browser.query '#title input'
        @a = browser.query '#title .editable'
        browser.fire 'click', browser.query('#title .editable'), done

      it 'an input box appears', ->
        should.exist @input
