Created
February 25, 2011 13:31
-
-
Save FooBarWidget/843778 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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