Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 22 lines (16 sloc) 0.591 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Browser = require 'zombie'
expect = require('chai').expect
app = require '../server'
sinon = require 'sinon'
Word = require '../models/word'

describe 'the main page', ->
  beforeEach (done) ->
    @stub = sinon.stub(Word._wordnik, 'randomWords').yields null, [ id: 1234, word: "hello" ]

    @browser = new Browser
    @browser.visit('http://localhost:3001/').then done, done

  afterEach ->
    @stub.restore()

  it 'should exist', ->
    expect(@browser.statusCode).to.equal 200

  it 'should have the words that were feteched', ->
    expect(@browser.text '.magnets' ).to.equal 'hello'
Something went wrong with that request. Please try again.