SignInButton = require '../../coffee/views/sign-in-button.coffee'

describe 'Sign in button view', ->
  button = new SignInButton()

  it 'should be a button element', ->
    button.tagName.should.equal('button')

  it 'should be a Backbone view', ->
    button.should.be.an.instanceof(Backbone.View)

  it 'should have the right classes', ->
    button.className.should.equal('btn btn-primary btn-lg sign-in')

  describe 'render', ->
    it 'should return a reference to the object', ->
      button.render().should.equal(button)

    it 'should set the text content to the correct string', ->
      button.$el.text().should.equal('Sign in')

  describe 'onClick', ->
    it 'should have a valid click handler', ->
      button.events.click.should.equal('onClick')
      button.onClick.should.be.a('function')
