Sha256: dc32954f5161d2a46e2e6b86283404325bfa807d24f3225a3343f50859bbf847

Contents?: true

Size: 863 Bytes

Versions: 20

Compression:

Stored size: 863 Bytes

Contents

module UserHelpers
  include Loco::Emitter

  def confirm_user name
    users(name).confirmed = true
    users(name).save!
  end

  def sign_in_user email, pass
    visit '/'
    click_on 'Sign in'
    fill_in 'Email', with: email
    fill_in 'Password', with: pass
    click_button 'Sign In'
  end

  def update_article name
    articles(name).tap do |a|
      a.title = 'WiAR'
      a.text = 'Lorem Ipsum II' * 8
      a.save!
    end
    emit articles(name), :updated, for: [users(:user_zbig)]
  end

  def destroy_article name
    article = articles name
    article.destroy
    emit article, :destroyed, for: [article.user]
  end

  def join_room user, room
    HubFinder.new(room).find.add_member user
    emit room, :member_joined, data: {
    room_id: room.id,
      member: {
        id: user.id,
        username: user.username,
      }
    }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
loco-rails-3.0.5 test/support/user_helpers.rb
loco-rails-3.0.4 test/support/user_helpers.rb
loco-rails-3.0.3 test/support/user_helpers.rb
loco-rails-2.5.3 test/support/user_helpers.rb
loco-rails-2.5.2 test/support/user_helpers.rb
loco-rails-3.0.2 test/support/user_helpers.rb
loco-rails-3.0.1 test/support/user_helpers.rb
loco-rails-2.5.1 test/support/user_helpers.rb
loco-rails-2.5.0 test/support/user_helpers.rb
loco-rails-2.4.0 test/support/user_helpers.rb
loco-rails-2.3.0 test/support/user_helpers.rb
loco-rails-3.0.0 test/support/user_helpers.rb
loco-rails-2.2.2 test/support/user_helpers.rb
loco-rails-2.2.1 test/support/user_helpers.rb
loco-rails-2.2.0 test/support/user_helpers.rb
loco-rails-2.1.0 test/support/user_helpers.rb
loco-rails-2.0.0 test/support/user_helpers.rb
loco-rails-1.5.2 test/support/user_helpers.rb
loco-rails-1.5.1 test/support/user_helpers.rb
loco-rails-1.5.0 test/support/user_helpers.rb