This gist contains all you need to setup capybara for selenium with headless chrome.
- Add these gems to the Gemfile under test group
gem 'capybara'
gem 'chromedriver-helper
gem 'selenium-webdriver'
#!/usr/bin/env ruby | |
# Validates that you don't commit forbidden keywords to the repo | |
# You can skip this checking with 'git commit --no-verify' | |
exit 0 if ARGV.include?('--no-verify') | |
# Update this list with your own forbidden keywords | |
KEYWORDS = %w(binding.pry console.log debugger) | |
def red(text) "\033[31m#{text}\033[0m"; end |
#!/usr/bin/env ruby | |
# Validates that you don't commit forbidden keywords to the repo | |
# You can skip this checking with 'git commit --no-verify' | |
exit 0 if ARGV.include?('--no-verify') | |
# Update this list with your own forbidden keywords | |
KEYWORDS = %w(binding.pry console.log debugger) | |
def red(text) "\033[31m#{text}\033[0m"; end |
#Brian Kernighan’s algorithm | |
def count_set_bits(num) | |
count = 0 | |
while num != 0 | |
num &= (num-1) | |
count += 1 | |
end | |
count | |
end |
def insert(new_node) | |
if tail == nil | |
new_node.next = new_node | |
tail = new_node | |
else | |
curr = tail.next | |
while curr.next != tail && curr.data <= new_node.data | |
curr = curr.next |
# Database cleaner configuration for apps using both mongoid and activerecord. | |
When your apps using multiple ORMs, you might want to fine tune each ORM in different way. | |
This contains the sample configuration for using mongoid and activerecord together. | |
This shows how to use different startegy for different ORMs. |
Type go
in terminal, to verify the installation.
Currently the godotenv library doesn't support loading different .env files such as .env.test for testing .env.staging for staging.
Here's the small snippet, to support different environments file dynamically. Based on the @adamcohen comment.(option 1)
joho/godotenv#43 - Follow this issue for future changes