Sha256: 4cbcbe750a7796f7f228c61830e984af431c1301d8787d91c5df2d06a9571e72

Contents?: true

Size: 633 Bytes

Versions: 11

Compression:

Stored size: 633 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require 'netzke-core'

module Netzke
  describe State do
    it "should be possible to save component's state" do
      component = Base.new(:name => 'some_component', :persistence => true)
      component.state.should == {}

      component.update_state(:value_to_remember, 42)
      component.state.should == {:value_to_remember => 42}

      component.update_state(:more_to_remember => "a string", :and_yet_more => "another string")
      component.state.should == {:value_to_remember => 42, :more_to_remember => "a string", :and_yet_more => "another string"}

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
netzke-core-0.7.7 test/core_test_app/spec/component/state_spec.rb
netzke-core-0.7.6 test/core_test_app/spec/component/state_spec.rb
netzke-core-0.7.5 test/core_test_app/spec/component/state_spec.rb
netzke-core-0.7.4 test/core_test_app/spec/component/state_spec.rb
netzke-core-0.7.3 test/core_test_app/spec/component/state_spec.rb
netzke-core-0.7.2 test/core_test_app/spec/component/state_spec.rb
netzke-core-0.7.1 test/rails_app/spec/component/state_spec.rb
netzke-core-0.6.7 test/rails_app/spec/component/state_spec.rb
netzke-core-0.7.0 test/rails_app/spec/component/state_spec.rb
netzke-core-0.6.6 spec/component/state_spec.rb
netzke-core-0.6.5 spec/component/state_spec.rb