This gist will give you a quick insight on how you can write unit tests with rspec!
Mini-topics covered:
- Defining test cases
- Writing your own factory
- Mocking methods/classes
- Expected test results;
- Writing controller specs
- Before you do....
| #!/usr/bin/env bash | |
| APPNAME=$(basename $0 | sed "s/\.sh$//") | |
| # ----------------------------------------------------------------------------- | |
| # Log functions | |
| # ----------------------------------------------------------------------------- | |
| fn_log_info() { echo "$APPNAME: $1"; } | |
| fn_log_warn() { echo "$APPNAME: [WARNING] $1" 1>&2; } |
| #!/bin/bash | |
| # NAME: full-backup | |
| # PATH: $HOME/bin | |
| # DESC: Full system backup - must call with SUDO | |
| # DATE: July 16, 2017. Modified July 26, 2017. | |
| apt autoclean # reduces size of /var/cache/apt/archives |
| <!--Developer's debug menu at bottom of index page--> | |
| <div id="accordion"> | |
| <div class="card"> | |
| <div class="card-header" id="headingOne"> | |
| <h5 class="mb-0"> | |
| <button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> | |
| Developer Debug Menu (click to toggle) | |
| </button> | |
| </h5> | |
| </div> |