Sha256: d22ff19ae93a7fc7f71151fa729723ead89380e7491bfd2a9eba2c9834c45594

Contents?: true

Size: 1.31 KB

Versions: 79

Compression:

Stored size: 1.31 KB

Contents

require 'spec_helper'

module Appstats
  describe Action do

    before(:each) do
      Appstats::Entry.delete_all
      Appstats::Action.delete_all
      @action = Appstats::Action.new
    end
    
    describe "#initialize" do

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

      it "should set plural_name to nil" do
        @action.plural_name.should == nil
      end

      it "should set status to nil" do
        @action.status.should == nil
      end
      
      it "should set on constructor" do
        action = Appstats::Action.new(:name => 'a', :plural_name => 'b', :status => 'c')
        action.name.should == 'a'
        action.plural_name.should == 'b'
        action.status.should == 'c'
      end
    
    end
    
    describe "#update_actions" do
      
      it "should do nothing if no events" do
        Appstats::Action.update_actions.should == 0
        Appstats::Action.count.should == 0
      end
      
      it "should add entry action names" do
        Appstats::Entry.create(:action => 'a')
        Appstats::Action.update_actions.should == 1
        Appstats::Action.count.should == 1
        
        action = Appstats::Action.last
        action.name = 'a'
        action.plural_name = 'as'
        action.status = 'derived'
      end
      
    end
    

  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
appstats-0.25.1 spec/action_spec.rb
appstats-0.25.0 spec/action_spec.rb
appstats-0.24.0 spec/action_spec.rb
appstats-0.23.5 spec/action_spec.rb
appstats-0.23.4 spec/action_spec.rb
appstats-0.23.3 spec/action_spec.rb
appstats-0.23.2 spec/action_spec.rb
appstats-0.23.1 spec/action_spec.rb
appstats-0.23.0 spec/action_spec.rb
appstats-0.22.6 spec/action_spec.rb
appstats-0.22.5 spec/action_spec.rb
appstats-0.22.4 spec/action_spec.rb
appstats-0.22.3 spec/action_spec.rb
appstats-0.22.2 spec/action_spec.rb
appstats-0.22.1 spec/action_spec.rb
appstats-0.22.0 spec/action_spec.rb
appstats-0.21.3 spec/action_spec.rb
appstats-0.21.2 spec/action_spec.rb
appstats-0.21.1 spec/action_spec.rb
appstats-0.20.12 spec/action_spec.rb