Skip to content

Instantly share code, notes, and snippets.

@ElMassimo
Last active October 29, 2018 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ElMassimo/d04b19be507c2d5ab40473c86a201103 to your computer and use it in GitHub Desktop.
Save ElMassimo/d04b19be507c2d5ab40473c86a201103 to your computer and use it in GitHub Desktop.
Capybara Test Helper - Snippet for Sublime Text
<snippet>
<content><![CDATA[
# frozen_string_literal: true
class $1TestHelper < CapybaraTestHelper
# Selectors: Semantic aliases for elements, a very useful abstraction.
SELECTORS = {$2}
# Getters: A convenient way to get related data or nested elements.
$3
# Actions: Encapsulate complex actions to provide a cleaner interface.
$4
# Assertions: Allow to check on element properties while keeping it DRY.
$5
# Background: Helpers to add/modify/delete data in the database or session.
$6
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>testhelper</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.ruby</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment