Sha256: 9976bfdba42be2c4d8e91048579308f52d50a2ce8353fb3dc2d6cff9957c02b2

Contents?: true

Size: 631 Bytes

Versions: 4

Compression:

Stored size: 631 Bytes

Contents

require 'test_helper'
require 'camping'
require 'camping/session'

Camping.goes :Sessions

module Sessions
  include Camping::Session
end

module Sessions::Controllers
  class One
    def get
      @state.clear
      @state.one = 42
      redirect R(Two)
    end
  end
  
  class Two
    def get
      @state.two = 56
      redirect R(Three)
    end
  end
  
  class Three
    def get
      @state.three = 99
      @state.values_at("one", "two", "three").inspect
    end
  end
end

class Sessions::Test < TestCase
  def test_session
    get '/one'
    follow_redirect!
    follow_redirect!
    assert_body "[42, 56, 99]"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
camping-2.1.532 test/app_sessions.rb
camping-2.1.531 test/app_sessions.rb
camping-2.1.523 test/app_sessions.rb
camping-2.1.467 test/app_sessions.rb