Sha256: 744b1e40a84fbc9b00ce47a010a76d58d65087595a52bbdb204056b19ec8b1a4

Contents?: true

Size: 826 Bytes

Versions: 2

Compression:

Stored size: 826 Bytes

Contents

require 'test_helper'

module Alondra
  class PushMessagesTest < ActiveSupport::IntegrationCase
    self.use_transactional_fixtures = false

    setup do
      clean_db
      Capybara.default_driver = :webkit
    end

    teardown do
      clean_db
    end

    test "execute messages in client" do
      self.extend Pushing

      @user = FactoryGirl.create :user
      @text = 'hola!'

      chat = FactoryGirl.create :chat, :name => 'A chat to receive messages'

      login_as @user

      chat_path = chat_path(chat)
      visit chat_path(chat)

      wait_until 10 do
        page.has_content? 'Subscribed to channel'
      end

      push :partial => '/shared/message', :to => chat_path
      
      sleep(0.1)

      wait_until 20 do
        page.has_content? "#{@user.username} says hola!"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alondra-0.1.1 test/integration/push_messages_test.rb
alondra-0.1.0 test/integration/push_messages_test.rb