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.17.0 spec/context_value_spec.rb
appstats-0.16.7 spec/context_value_spec.rb
appstats-0.16.6 spec/context_value_spec.rb
appstats-0.16.5 spec/context_value_spec.rb
appstats-0.16.4 spec/context_value_spec.rb
appstats-0.16.3 spec/context_value_spec.rb
appstats-0.16.2 spec/context_value_spec.rb
appstats-0.16.1 spec/context_value_spec.rb
appstats-0.15.1 spec/context_value_spec.rb
appstats-0.15.0 spec/context_value_spec.rb
appstats-0.14.0 spec/context_value_spec.rb
appstats-0.13.4 spec/context_value_spec.rb
appstats-0.13.3 spec/context_value_spec.rb
appstats-0.13.2 spec/context_value_spec.rb
appstats-0.13.1 spec/context_value_spec.rb
appstats-0.13.0 spec/context_value_spec.rb
appstats-0.12.5 spec/context_value_spec.rb
appstats-0.12.4 spec/context_value_spec.rb
appstats-0.12.2 spec/context_value_spec.rb
appstats-0.12.1 spec/context_value_spec.rb