If your controller action looks like this:
respond_to do |format| format.html { raise \'Unsupported\' } format.js # index.js.erb end
and yo
with rspec:
it "should render js" do xhr :get, 'index' response.content_type.should == Mime::JS end
and in your controller action:
respond_to do |format| format.js end