Better integration specs #344

Merged
merged 3 commits into from Nov 16, 2012

Projects

None yet

3 participants

Contributor
haines commented Nov 16, 2012

I realised a headless browser is overkill for just verifying the generated html, so I've switched it to just do a Net::HTTP.get.

I also greatly simplified the integration specs (all the lets and shared examples were making it unintelligible) and added a custom matcher, both of which make the failure messages much more informative.

And now Rubinius works again!

Member
nashby commented Nov 16, 2012

Hrm, why not to use Capybara with Rack::Test?

Contributor
haines commented Nov 16, 2012

Draper's behaviour is quite different between test, development, and production environments, so we need to be sure that the integration tests are exercising these differences.

If we use Rack::Test, can we run in the different environments? And does Rails treat the requests the same way as a real request?

I'm not sufficiently familiar with Rack::Test to answer those questions, so I just went for the explicit approach (following focused_controller) because by running the real server we can be sure we're testing the real behaviour.

@steveklabnik steveklabnik merged commit d2e4d21 into drapergem:master Nov 16, 2012

1 check passed

default The Travis build passed
Details
Owner

Seems good. Even if we can use Rack::Test, this is an improvement for now. Thanks a lot @haines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment