Sha256: ea16f0c4ea628458fc1de7997d16b1c1481f68aeaacca1f0e3d920f883807b7b
Contents?: true
Size: 1.22 KB
Versions: 44
Compression:
Stored size: 1.22 KB
Contents
require 'spec_helper' module Appstats describe ContextKey do before(:each) do Appstats::Context.delete_all Appstats::ContextKey.delete_all @context_key = Appstats::ContextKey.new end describe "#initialize" do it "should set name to nil" do @context_key.name.should == nil end it "should set status to nil" do @context_key.status.should == nil end it "should set on constructor" do context_key = Appstats::ContextKey.new(:name => 'a', :status => 'c') context_key.name.should == 'a' context_key.status.should == 'c' end end describe "#update_context_keys" do it "should do nothing if no events" do Appstats::ContextKey.update_context_keys.should == 0 Appstats::ContextKey.count.should == 0 end it "should add entry context_key names" do Appstats::Context.create(:context_key => 'a') Appstats::ContextKey.update_context_keys.should == 1 Appstats::ContextKey.count.should == 1 context_key = Appstats::ContextKey.last context_key.name = 'a' context_key.status = 'derived' end end end end
Version data entries
44 entries across 44 versions & 1 rubygems