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

Cannot get test working and looking for some code cleanup tips

Hello,

I've been working on a rails app and am unable to figure out why my spec is not working when I believe it should be.

My code is the year_setup brach of this repo.

The weird thing is, with JS disabled, the line passes, but with JS enabled, it fails. However, manual testing indicates that everything is functioning "properly"(at least for its current state)

I'd also love any general feedback that you might have on anything I can clean up in the rails code that would make things cleaner. It feels like to me that stuff is very messy, but I'm not sure if there's much I can do to get it much cleaner. Between the specs and the views, things just seem cluttered.

Adam Sommer
Adam Sommer
62,470 Points

Can you post a link to the exact spec, or spec file, that isn't working? I took a look at your repo, but it's not exactly clear which test you're having a problem with.

1 Answer

I managed to find the solution to the problem. It turns out the javascript engine is stricter than the non javascript engine on its paths for the visit command. They needed to be in the form "/somewhere" instead of what I had been using of "somewhere".