Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

RoR tests from "Build a Simple Ruby on Rails Application Testing the Whole App Integration Tests"

I don't understand what's going on with the tests.

test "that /login route opens the login page" do
    get '/login'
    assert_response :success

Is what is between the double quotation marks on the first line just describing what's going on for the developer? Or is it code itself?

What is the difference in other testing...languages? Is that the correct word? I was running through Michael Hartl's tutorial also and he uses Capybara. But whenever I've searched for RoR tests most of the results are centered around Cucumber. What is the difference?

And how does Rspec come into play with this?

1 Answer

The text within the double quotes is just to describe what the test is doing. You could put anything inside there, but it's obviously a good idea to describe what functionality or result you are testing for.

As I understand it, Cucumber is a great way to generate some skeleton tests by using some plain english to describe functionality. It doesn't generate the actual test (the stuff between the "do" and "end") though.