Based on the popular open-source contract for web professionals by Stuff & Nonsense
This version:
- made for use by a single Web Developer based in the United States.
Between [company name]
This version:
Between [company name]
I hereby claim:
To claim this, I am signing this object:
module MemoryLogger | |
def log_memory(&block) | |
begin | |
log_start | |
thread = create_memory_log_thread | |
yield | |
ensure | |
Thread.kill(thread) | |
log_finish | |
end |
# Updated version of the following gist: | |
# https://gist.github.com/stevenzeiler/1895583 | |
# | |
# list = Linkedin::IndustryList.new | |
# industry = list.industries.first | |
# | |
# industry.description | |
# => "Accounting" | |
# | |
# industry.code |
# test/support/capybara_helpers.rb | |
def fill_in_trix_editor(id, with:) | |
find(:xpath, "//trix-editor[@input='#{id}']").click.set(with) | |
end | |
def find_trix_editor(id) | |
find(:xpath, "//*[@id='#{id}']", visible: false) | |
end |
# test/fixtures/articles.yml | |
trix_capybara: | |
title: Testing the Trix Editor with Capybara | |
content: <div>We are going to learn some cool stuff!</div> |
# test/test_helper.rb | |
ENV['RAILS_ENV'] ||= 'test' | |
require_relative '../config/environment' | |
require 'rails/test_help' | |
# Be sure to add this line to include all support files | |
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } | |
class ActiveSupport::TestCase | |
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. |
# test/system/article/post_test.rb | |
require 'application_system_test_case' | |
class Articles::PostTest < ApplicationSystemTestCase | |
setup do | |
sign_in_as users(:will) | |
visit articles_path | |
end | |
test 'post a new article' do |