Testing with Rspec

20
Testing with rspec

description

Basic informations about testing using Rspec

Transcript of Testing with Rspec

Page 1: Testing with Rspec

Testing with rspec

Page 2: Testing with Rspec

Simple test

Page 3: Testing with Rspec

Lets are awesome

Page 4: Testing with Rspec

Subjects are awesome too

Page 5: Testing with Rspec

Use '#' for instance methods and '.' for class methods

Page 6: Testing with Rspec

Use contexts

Page 7: Testing with Rspec

Stubs vs mocks

Page 8: Testing with Rspec

Stubs vs mocks

Page 9: Testing with Rspec

Factory Girl

Page 10: Testing with Rspec

Factory Girl

Page 11: Testing with Rspec

Only one assertion per example

Page 12: Testing with Rspec

Only one assertion per example

Page 13: Testing with Rspec

Shared examples

Page 14: Testing with Rspec

Shared examples

Page 15: Testing with Rspec

Keep description shortDon't use 'should'

Page 16: Testing with Rspec

Spork

Page 17: Testing with Rspec

Guard

Page 18: Testing with Rspec

Stubbing HTTP requests -webmock

Page 19: Testing with Rspec

Recording HTTP requests - vcr

Page 20: Testing with Rspec

Questions?