Sha256: 2fb9448986be2ad158dd20fd78021bf315bbcaf9f0fd88ed150665f5754544a4

Contents?: true

Size: 1.02 KB

Versions: 8

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.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

8 entries across 8 versions & 1 rubygems

Version Path
rhoconnect-4.0.4 spec/read_state_spec.rb
rhoconnect-4.0.3 spec/read_state_spec.rb
rhoconnect-4.0.2 spec/read_state_spec.rb
rhoconnect-4.0.1 spec/read_state_spec.rb
rhoconnect-4.0.0 spec/read_state_spec.rb
rhoconnect-4.0.0.beta.24 spec/read_state_spec.rb
rhoconnect-4.0.0.beta.10 spec/read_state_spec.rb
rhoconnect-4.0.0.beta.12 spec/read_state_spec.rb