Skip to content

Instantly share code, notes, and snippets.

@FooBarWidget
Created February 25, 2011 13:31
Show Gist options
  • Save FooBarWidget/843778 to your computer and use it in GitHub Desktop.
Save FooBarWidget/843778 to your computer and use it in GitHub Desktop.
class FoobarController < ActionController::Base
def index
session[:foo] = params[:foo]
render :text => "saved session: #{session.inspect}"
end
def show
render :text => "current session: #{session.inspect}"
end
end
require 'test_helper'
class FoobarTest < ActionController::IntegrationTest
fixtures :all
test "the truth" do
get '/foobar', :foo => 'value'
puts response.body
get '/foobar/show'
# expecting "current session: {:foo => 'value'}"
# got "current session: {}"
puts response.body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment