When(/(they)? ?sends? the message (.+)$/) do |they, message|
  page.find('.new-comment textarea').fill_in(with: message)
  page.find('.new-comment .send-button').click()
end

When(/a (blocked)? ?message reading (.+) is sent/) do |blocked, message|
  @context.create_user()
  @context.send_message(@context.firebase_user, message, !blocked.nil?)
end

Then(/should (not)? ?see (.+)'s? message saying (.*)/) do |negate, username, message|
  if negate.nil?
    expect(page).to have_text("#{username}: #{message}", count: 1)
  else
    expect(page).not_to have_text("#{username}: #{message}")
  end
end
