Workflow Step by Step - MikeAndrianov/easy_learning GitHub Wiki
- Go to Issues page
- Select task
- Discuss with other team members
###Code
- Rspec first
- Refactoring ( 50% of time )
- DRY
- Reuse the code
- Commenting & Documentation
- Indentation
- Naming Scheme
- Limit Line Length
- Separation of Code and Data
- Iteratively write code & specs - until the feature is finished
- Fix any tests that have failed after your feature
- We're following the same style guide as Github Ruby Style Guide does.
###Comments Put comments to ALL classes/modules, to any non trivial or complicated methods. Leave one separate commented line between comments and a definition, so the text is separated from the code and the link is maintained
for a module or a class
# Declares smth...
#
class / module ClassOrModuleName
for a methods within a module or class
# Returns smth...
#
def method_name
- Create new branch from MASTER branch
- Use branch names
g<Issue number>_<FIO>__<task description>
- More about Git workflow
###Commiting policy
- Should contain logically linked changes
- Message should be descriptive
- Do not do very large commits
- Use auto descriptors
###How to commit
- Create a commit with description of what has changed from the previous state
- Create new pull request
- Ask team members to review your pull request
- Resolve any questions that may appear
- guard for testing automation
- spork for quicker testing
- rspec + cucumber
- If you are removing the functionality - you should remove the spec / or test that this functionality no longer available
- If you are not clear about how to implement the spec - leave it "defines your custom case" without block
- If test is failing - it should be fixed
test suit should always pass.
- Use: context {}, specify {}, it {}, subject {}, describe {}
- Start context with ‘when’/'with’ and methods description with ‘#’ context "when logged in"
- Use RSpec matchers to get meaningful messages specify { user.should be_valid } -is better then == true
- Only one expectation per it block
- Test Valid, Edge and Invalid cases
- Use let for eager loading
- First #describe what you are doing
- Then establish the #context
- #it only expects one thing
- Run specs to confirm readability
- Use the right matcher
- Formatting - used do end blocks