As I upgraded my rails 2.x site to rails 3.0.7, I decided to swap the
respond block on my controller actions to “respond_with”.
I have respond_to :html, :xml, :mobile since I have mobile.erb
templates. I have zero issues with testing until I swapped to
respond_with in my controllers.
Now if I test functionals using default rails testing, the html tests
all come out perfect, but the mobile tests state that there are unknown
methods which are false. Here’s an example of a quick test:
HTML format that passes:
test “should get index” do
MOBILE format that fails:
test “should get index.mobile.erb” do
@request.accept = “mobile”
get :index, :format => :mobile
assert_select “table[class=grad header wide]”
The html format does not post an error and @conferences in the
controller has an assignment. There is nothing different in either the
html or mobile erb formats. Yet, the mobile fails stating that
conferences is an unknown method…
Any ideas what the issue is with the respond_with part for testing?