Sha256: bf7e57fa4fe8e8d8e898498bf5dc860954b7661085b318e72c26023f5a929af7

Contents?: true

Size: 962 Bytes

Versions: 25

Compression:

Stored size: 962 Bytes

Contents

require 'spec_helper'

describe Lifen::Message do

  let(:valid_token_value)   { "valide_token" }
  # let(:valid_token_value)   { "REPLACE_ME" }

  let(:valid_token)         { Lifen::Token.new(value: valid_token_value, expires_at: Time.now.to_i + 60) }
  let(:user)                { Lifen::User.new(token: valid_token) }

  let(:flow)                { Lifen::Flow.new(user: user, uuid: "11e6be18-7a35-d759-9177-0242ac110002") }
  let(:message)             { Lifen::Message.new(flow: flow, content: "Bonjour Lifen") }

  describe "create" do

    context "valid message" do

      it 'has valid attributes' do

        VCR.use_cassette "messages/valid_message" do
          message.create
        end

        expect(message.uuid).to eq("11e6be20-5647-8f9b-9177-0242ac110002")
        expect(message.type).to eq("regular")
        expect(message.flow).to eq(flow)
        expect(message.sent_at.to_date).to eq Date.new(2016, 12, 9)

      end

    end

  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
lifen-4.0.0 spec/message_spec.rb
lifen-3.0.0 spec/message_spec.rb
lifen-2.4.0 spec/message_spec.rb
lifen-2.3.0 spec/message_spec.rb
lifen-2.2.0 spec/message_spec.rb
lifen-2.1.0 spec/message_spec.rb
lifen-2.0.0 spec/message_spec.rb
lifen-1.6.8 spec/messages_spec.rb
lifen-1.6.7 spec/messages_spec.rb
lifen-1.6.6 spec/messages_spec.rb
lifen-1.6.5 spec/messages_spec.rb
lifen-1.6.4 spec/messages_spec.rb
lifen-1.6.3 spec/messages_spec.rb
lifen-1.6.2 spec/messages_spec.rb
lifen-1.6.1 spec/messages_spec.rb
lifen-1.6.0 spec/messages_spec.rb
lifen-1.5.2 spec/messages_spec.rb
lifen-1.5.1 spec/messages_spec.rb
lifen-1.5.0 spec/messages_spec.rb
lifen-1.4.0 spec/messages_spec.rb