Sha256: 1c9de10888116a32c913d598051f451e537079424496655666faeb5bb2abb9e5

Contents?: true

Size: 1.27 KB

Versions: 70

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

module Appstats
  describe ContextValue do

    before(:each) do
      Appstats::Context.delete_all
      Appstats::ContextValue.delete_all
      @context_value = Appstats::ContextValue.new
    end
    
    describe "#initialize" do

      it "should set name to nil" do
        @context_value.name.should == nil
      end

      it "should set status to nil" do
        @context_value.status.should == nil
      end
      
      it "should set on constructor" do
        context_value = Appstats::ContextValue.new(:name => 'a', :status => 'c')
        context_value.name.should == 'a'
        context_value.status.should == 'c'
      end
    
    end
    
    describe "#update_context_values" do
      
      it "should do nothing if no events" do
        Appstats::ContextValue.update_context_values.should == 0
        Appstats::ContextValue.count.should == 0
      end
      
      it "should add entry context_value names" do
        Appstats::Context.create(:context_value => 'a')
        Appstats::ContextValue.update_context_values.should == 1
        Appstats::ContextValue.count.should == 1
        
        context_value = Appstats::ContextValue.last
        context_value.name = 'a'
        context_value.status = 'derived'
      end
      
    end
    

  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
appstats-0.20.11 spec/context_value_spec.rb
appstats-0.20.10 spec/context_value_spec.rb
appstats-0.20.9 spec/context_value_spec.rb
appstats-0.20.8 spec/context_value_spec.rb
appstats-0.20.7 spec/context_value_spec.rb
appstats-0.20.6 spec/context_value_spec.rb
appstats-0.20.2 spec/context_value_spec.rb
appstats-0.20.1 spec/context_value_spec.rb
appstats-0.20.0 spec/context_value_spec.rb
appstats-0.19.7 spec/context_value_spec.rb
appstats-0.19.6 spec/context_value_spec.rb
appstats-0.19.2 spec/context_value_spec.rb
appstats-0.19.1 spec/context_value_spec.rb
appstats-0.19.0 spec/context_value_spec.rb
appstats-0.18.0 spec/context_value_spec.rb
appstats-0.17.5 spec/context_value_spec.rb
appstats-0.17.4 spec/context_value_spec.rb
appstats-0.17.3 spec/context_value_spec.rb
appstats-0.17.2 spec/context_value_spec.rb
appstats-0.17.1 spec/context_value_spec.rb