Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test controller that uses Tubesock with RSpec #41

Closed
dchacke opened this issue Feb 23, 2015 · 1 comment
Closed

Test controller that uses Tubesock with RSpec #41

dchacke opened this issue Feb 23, 2015 · 1 comment

Comments

@dchacke
Copy link

dchacke commented Feb 23, 2015

It appears that controller specs fail because Puma is not running in RSpec controller tests:

Failure/Error: get :index
Tubesock::HijackNotAvailable:
Tubesock::HijackNotAvailable

How can one get around this so as to test controllers that use Tubesock?

@ngauthier
Copy link
Owner

Hi,

An RSpec controller test tests a controller as a unit in isolation. That means that collaborators of the controller should be faked/mocked/stubbed. So you should apply the appropriate technique to the Tubesock class (or wrap it yourself and fake/mock/stub your wrapper, which is recommended) so that the tubesock code is not exercised during the controller test.

Please share your results as I expect others are interested in this as well.

Nick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants