Skip to content

Commit

Permalink
Adds failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
rdiazv committed Jun 27, 2017
1 parent c197efe commit b612355
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions __tests__/Model.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ describe('Model', () => {
model.collection = null
})

it('sends merged attributes on the request', () => {
const adapter = apiClient()
const spy = jest.spyOn(adapter, 'post')

model.save({ name })

expect(spy).toHaveBeenCalledTimes(1)
expect(spy.mock.calls[0][1]).toEqual({
name: 'dylan',
album: 'kind of blue'
})

spy.mockReset()
spy.mockRestore()
})

describe('if its optimistic (default)', () => {
it('it sets model straight away', () => {
model.save({ name })
Expand Down

0 comments on commit b612355

Please sign in to comment.