Sha256: d328bbef7e04f9ec66795ac6a6b8cf639d02d43d356c10a0eda1c720784f8327

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

require File.join(File.dirname(__FILE__),'spec_helper')

describe "ReadState" do
  it_behaves_like "SharedRhoconnectHelper", :rhoconnect_data => false do
    it "should create refresh with correct id" do
      @r.id.should == "#{@a_fields[:name]}:#{@u_fields[:login]}:#{@s_fields[:name]}"
    end

    it "should create refresh with default fields" do
      @r.refresh_time.should <= Time.now.to_i
    end

    it "should load refresh with params" do
      @r1 = ReadState.load(:app_id => @a_fields[:name],
        :user_id => @u_fields[:login],:source_name => @s_fields[:name])
      @r1.refresh_time.should <= Time.now.to_i
    end

    it "should delete read_state from db" do
      ReadState.delete(@a_fields[:name])
      Store.db.keys("read_state*").should == []
    end
    
    it "should delete read_state from source" do
      time = Time.now.to_i
      @s.read_state.refresh_time = time
      @s.load_read_state.refresh_time.should == time

      @s.delete_user_read_state
      @s.load_read_state.should == nil
    end
      
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-3.4.5 spec/read_state_spec.rb
rhoconnect-3.4.4 spec/read_state_spec.rb
rhoconnect-3.4.3 spec/read_state_spec.rb
rhoconnect-3.4.2 spec/read_state_spec.rb
rhoconnect-3.3.6 spec/read_state_spec.rb
rhoconnect-3.3.5 spec/read_state_spec.rb
rhoconnect-3.3.4 spec/read_state_spec.rb
rhoconnect-3.3.3 spec/read_state_spec.rb
rhoconnect-3.3.2 spec/read_state_spec.rb
rhoconnect-3.3.1 spec/read_state_spec.rb
rhoconnect-3.3.1.beta4 spec/read_state_spec.rb
rhoconnect-3.3.1.beta3 spec/read_state_spec.rb
rhoconnect-3.3.1.beta2 spec/read_state_spec.rb
rhoconnect-3.2.1 spec/read_state_spec.rb
rhoconnect-3.2.0 spec/read_state_spec.rb
rhoconnect-3.2.0.beta5 spec/read_state_spec.rb
rhoconnect-3.2.0.beta4 spec/read_state_spec.rb
rhoconnect-3.2.0.beta3 spec/read_state_spec.rb
rhoconnect-3.2.0.beta2 spec/read_state_spec.rb
rhoconnect-3.2.0.beta1 spec/read_state_spec.rb