This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: NameGenerator.generate | |
# | |
module NameGenerator | |
def self.generate | |
[ADVERBS.sample, ADJECTIVES.sample, NAMES.sample].join("_") | |
end | |
NAMES = [ | |
"ai", | |
"analytics", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: spec/support/vcr.rb | |
require 'vcr' | |
# More info: | |
# - https://github.com/vcr/vcr | |
# - https://relishapp.com/vcr/vcr/docs | |
VCR.configure do |config| | |
config.cassette_library_dir = File.expand_path(File.join(__dir__, "..", "support", "vcr_cassettes")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allows you to run rspec with SCREENSHOT=1 to take screenshots. | |
# The images are stored under tmp/screenshots/ | |
# | |
module ScreenshotHelpers | |
SCREENSHOT_KEY = 'SCREENSHOT' | |
DIR_PATH = Rails.root.join('tmp', 'screenshots') | |
# @example | |
# screenshot("dashboard_clean_slate") | |
# screenshot("shopping_cart_multiple_items") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: spec/support/database_cleaner.rb | |
require 'database_cleaner' | |
# More info: https://github.com/DatabaseCleaner/database_cleaner | |
RSpec.configure do |config| | |
config.before(:suite) do | |
# Ensure a clean slate | |
DatabaseCleaner.clean_with(:truncation) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Minimimal example: | |
# | |
# cors_headers https://www.google.com | |
# | |
# Example with origin (-o): | |
# | |
# cors_headers -o localhost https://www.google.com | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make it easier to call rails routes from anywhere | |
class Routes | |
include Rails.application.routes.url_helpers | |
delegate :asset_path, :image_path, to: :controller_helpers | |
protected | |
def controller_helpers | |
ActionController::Base.helpers |
OlderNewer