Skip to content

Commit

Permalink
Ensure calling reset session twice does not raise errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Nov 20, 2010
1 parent 8796f9a commit d5779ef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions actionpack/test/activerecord/active_record_store_test.rb
Expand Up @@ -23,6 +23,7 @@ def get_session_id
def call_reset_session def call_reset_session
session[:foo] session[:foo]
reset_session reset_session
reset_session if params[:twice]
session[:foo] = "baz" session[:foo] = "baz"
head :ok head :ok
end end
Expand Down Expand Up @@ -94,6 +95,17 @@ def test_getting_nil_session_value
end end
end end


def test_calling_reset_session_twice_does_not_raise_errors
with_test_route_set do
get '/call_reset_session', :twice => "true"
assert_response :success

get '/get_session_value'
assert_response :success
assert_equal 'foo: "baz"', response.body
end
end

def test_setting_session_value_after_session_reset def test_setting_session_value_after_session_reset
with_test_route_set do with_test_route_set do
get '/set_session_value' get '/set_session_value'
Expand Down

0 comments on commit d5779ef

Please sign in to comment.