Topic: Functional test failure with assert assigns
I'm trying to do a functional test but it's failing when checking to see if a variable has been assigned. At first I thought it might just be that nothing was being found with my model but I've now tried it with a simple string variable that I'm setting and it is still failing to be assigned. It might be because I have a redirect (I'm using globalize which is redirecting to /en/controller) - if this is the case how can I get round it?
Here's my controller code:
class MainController < ApplicationController
@page_title = "Learning Journey"
@categories = Category.find_by_published.find_top_level
And here's my test:
assert_redirected_to :locale => 'en', :controller => 'main', :action => 'index'
Is it the redirect causing the assigns not to work? If not, what am I doing wrong?