Understanding
29 Jul 2016
Reading time ~1 minute
What I Did
- Spent most of the day trying to further understand how Rails is actually integrated with CK. Though, I’ve already finished building out the CK components for “These Numbers Matter”, I only feel confident now regarding how all the moving pieces actually work.
- During the remainder of my time, I reasoned through what kind of specs would be sensible for “These Numbers Matter” keeping in mind that the site is a single page site, with almost no user interactions.
What I Learned
- XPath is a syntax for defining parts of an XML document and it uses path expressions to navigate XML documents.
- I reviewed the possible before blocks within Capybara:
before(:all)
runs the block a single time before all examples are run.before(:each)
runs the block on time before each example.
- I’ve dug a bit deeper into what’s possible with FactoryGirl including traits.
- Linting is the process of analyzing code to detect potential errors. Factory linting is the process of detecting potential errors by validating attributes set in the factory.
classify
renames a given string to match the appropriate case structure of a proper class name.constantize
creates an actual class name from a string. Thus,constantize
is often called after aclassify
is called on a string.fetch
returns a value from the hash for a given key. If no key is found, it will raise a KeyError exception unless a default value (e.g.nil
) or code block is provided in the method call.