spec/ramaze/helper/csrf.rb in ramaze-2012.04.14 vs spec/ramaze/helper/csrf.rb in ramaze-2012.12.08b

- old
+ new

@@ -18,22 +18,10 @@ def get return get_csrf_token end - def regenerate - $token_sess = session[:_csrf][:token] - $token_method = get_csrf_token - end - - def check_ttl - generate_csrf_token :ttl => 3 - $old_token = get_csrf_token - sleep 4 - $new_token = get_csrf_token - end - def check_post "POST allowed." end def get_token @@ -54,23 +42,9 @@ it 'retrieve the current CSRF token' do got = get '/get' got.status.should.equal 200 got.body.length.should.equal 128 - end - - it 'generate a new token if the previous one is valid' do - got = get '/regenerate' - - got.status.should.equal 200 - $token_sess.should.not.equal $token_method - end - - it 'expire token after 3 seconds' do - got = get '/check_ttl' - - got.status.should.equal 200 - $old_token.should.not.equal $new_token end it 'validate all HTTP requests' do methods = [:get, :post, :put, :delete]