Sha256: df2c5ce1186c2a7c3e04a61992ef582a266596b3933b99369c02cf38f39f1f7a
Contents?: true
Size: 1.09 KB
Versions: 14
Compression:
Stored size: 1.09 KB
Contents
require File.join(File.dirname(__FILE__),'spec_helper') require File.join(File.dirname(__FILE__), 'support', 'shared_examples') 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
14 entries across 14 versions & 1 rubygems