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

Ruby Scoping

When I run my test I keep getting test/functional/profiles_controller_test.rb:27: syntax error, unexpected $end, expecting keyword_end. Anyone have a suggestion?

require 'test_helper'

class ProfilesControllerTest < ActionController::TestCase
test "should get show" do
    get :show, id: users(:jason).profile_name
    assert_response :success
    assert_template 'profiles/show'
end

test "should render a 404 on profile not found" do
    get :show, id: "doesn't exist"
    assert_response :not_found
end

test "that variables are assigned on successful profile viewing" do
    get :show, id: users(:jason).profile_name
    assert assigns(:user)
    assert_not_empty assigns(:statuses)
end

test "only shows the correct user's statuses" do
    get :show, id: users(:jason).profile_name
    assigns(:statuses).each do |status|
        assert_equal users(:jason), status.user
    end
end

1 Answer

Just realized I forgot the final end