Sha256: 2d747ec4a75e9f2be23e33d1cd7cca004591367f89b2246da4680d577dcf5ad9

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'flydata-core/event/flydata_event'

module FlydataCore
  module Event
    describe  FlydataEvent do
      describe "#initialize" do
        let(:noun){"test"}
        let(:verb){"testing"}
        let(:data){{test:123}}

        context "when noun and verb are passed" do
          it {
            event = FlydataEvent.new(noun,verb, nil,1)
            expect(event.noun).to eql(noun)
            expect(event.verb).to eql(verb)
            expect(event.data).to be_nil
            expect(event.id).not_to be_nil
            expect(event.data_entry_id).to eql(1)
            expect(event.created).not_to be_nil
          }
        end

        context "when noun, verb and data are passed" do
          it {
            event = FlydataEvent.new(noun,verb,data,1)
            expect(event.noun).to eql(noun)
            expect(event.verb).to eql(verb)
            expect(event.data).to eql(data)
            expect(event.data_entry_id).to eql(1)
            expect(event.id).not_to be_nil
            expect(event.created).not_to be_nil
          }
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flydata-0.6.0 flydata-core/spec/event/flydata_event_spec.rb
flydata-0.5.21 flydata-core/spec/event/flydata_event_spec.rb
flydata-0.5.20 flydata-core/spec/event/flydata_event_spec.rb