Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| # README | |
| # pass in this file when creating a rails project | |
| # | |
| # for example: | |
| # rails _3.2.14_ new awesome_app -T -d postgresql -m ~/.kickhash_template.rb | |
| remove_file "README.rdoc" | |
| create_file "README.md", "TODO" | |
| gem_group :development, :test do |
| $ rails _3.2.14_ new cuke -T -d postgresql | |
| // no tests -T | |
| Gemfile | |
| group :test do | |
| gem 'cucumber-rails', require: false | |
| gem 'rspec-rails' | |
| gem 'guard-cucumber' | |
| gem 'database-cleaner' | |
| gem 'guard-rspec' |
| # README | |
| # pass in this file when creating a rails project | |
| # | |
| # for example: | |
| # rails _3.2.14_ new awesome_app -d postgresql -m ~/rails_setup.rb | |
| remove_file "README.rdoc" | |
| create_file "README.md", "TODO" | |
| gem_group :development, :test do |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| namespace :travis do | |
| desc "Prepare DB and run Tests" | |
| task :run do | |
| ["rake db:create", "rake db:migrate RAILS_ENV=test", "rake db:seed" | |
| "rspec spec", "rake jasmine:ci"].each do |cmd| | |
| puts "Starting to run #{cmd}..." | |
| system("bundle exec #{cmd}") | |
| raise "#{cmd} failed!" unless $?.exitstatus == 0 | |
| end |
| group :development, :test do | |
| gem 'rspec-rails' | |
| gem 'jasmine' | |
| gem 'pry-rails' | |
| end | |
| >rails g jasmine:install | |
| >rails g rspec:install | |
| >bundle |
| Go to Travis CI | |
| click sync now to show a recent repo | |
| click on it to enable Travis | |
| go to base directory and add .travis.yaml (touch .travis.yml) | |
| in Travis: | |
| language: ruby |
| i.e. RAILS_ENV = (development, test, production) | |
| Gemfile: | |
| gem "rspec-rails", :group => [:test, :development] | |
| gem 'jquery-rails' | |
| development: | |
| adapter: postgresql |
| go to your directory | |
| run --> rspec --init | |
| cd into rspec (this is where you create your helper, i.e. bus_spec.rb), or just use touch to place them | |
| cd .. | |
| run --> rspec spec/ | |
| run --> bundle init | |
| add gem 'rspec' | |
| add gem 'guard-rspec' | |
| run --> bundle install |