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

Benjamin Sunderland
Benjamin Sunderland
4,709 Points

How do I test for my root in rails?

Hi,

For example, I have:

require 'test_helper'

class StaticPagesControllerTest < ActionDispatch::IntegrationTest

test "should get home" do get static_pages_home_url assert_response :success end

end

This WORKS. However, I want to test for my posts#index which I made my root but it isn't passing. My index is my route so it should be this ---->I am trying:

require 'test_helper'

class PostsControllerTest < ActionDispatch::IntegrationTest

test "should get index" do
    /
    assert_response :success

 end

end

Why isn't that working as the I have made '/' the root path for my posts ---> index.html.erb