Skip to content

Instantly share code, notes, and snippets.

View ExReanimator's full-sized avatar

Ivan Schneider ExReanimator

  • HCM4all gmbh
  • Augsburg, Bavaria, Germany
View GitHub Profile
@cblavier
cblavier / wait_helper.ex
Created October 7, 2019 15:26
Wait helpers, used with Elixir hound browser testing library
defmodule MyApp.WaitHelper do
use Hound.Helpers
def wait_until(fun), do: wait_until(1000, fun)
def wait_until(0, fun), do: fun.()
def wait_until(timeout, fun) do
fun.()
rescue
Hound.NoSuchElementError -> retry(timeout, fun)
@averyvery
averyvery / application.rb
Last active May 27, 2024 07:35
Inline CSS or JS in Rails
config.assets.precompile += [
# precompile any CSS or JS file that doesn't start with _
/(^inline[^_\/]|\/[^_])[^\/]*.(js|css)$/,
...
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')