Project

General

Profile

Feature #29041 » sessions_controller_test.rb.patch

Pavel Rosický, 2018-06-17 19:55

View differences:

sessions_controller_test.rb (working copy)
45 45
    assert_not_equal created.to_i, token.updated_on.to_i
46 46
    assert token.updated_on > created
47 47
  end
48
  
49
  def test_session_token_should_be_updated_only_once_per_minute
50
    token = Token.create!(:user_id => 2, :action => 'session', :created_on => 1.second.ago, :updated_on => 1.second.ago)
51
    updated = token.reload.updated_on
52
    
53
    get :index, :session => {
54
      :user_id => 2,
55
      :tk => token.value
56
    }
57
    assert_response :success
58
    token.reload
59
    assert_equal updated.to_i, token.updated_on.to_i
60
  end
48 61

  
49 62
  def test_user_session_should_not_be_reset_if_lifetime_and_timeout_disabled
50 63
    created = 2.years.ago
(2-2/4)