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

Integration Testing Friendships - Test error

This is the test from the video;

 require 'test_helper'

class AddAFriendTest < ActionDispatch::IntegrationTest
    def sign_in_as(user, password)
    post login_path, user: { email: user.email, password: password }
 end

 test "that adding a friend works" do
     sign_in_as users(:matt), "testing"

     get "/user_friendships/new?friend_id=#{users(:mike).profile_name}"
     assert_response :success
  end
end

but unlike the video i get an error from my console:

[1/1] AddAFriendTest#test_that_adding_a_friend_works = 0.12 s 1) Error: test_that_adding_a_friend_works(AddAFriendTest): ActionController::RoutingError: uninitialized constant Devise::SessionController

any ideas ?

2 Answers

Fixed! had a typo in my routes.rb file: had session instead of sessions --- my bad lol

ahh glad you were able to sort this out! Typos, my achilles heal I swear :)

Did you THROW this line in test_heper.rb?

include Devise::TestHelpers

-twiz

Yeh I have That line