save_and_open_page
have_button(locator)| <leader>t RunCurrentSpecFile | |
| <leader>s RunNearestSpec | |
| <leader>l RunLastSpec | |
| <leader>a RunAllSpecs | |
| # Install Vim plugins: vim-rspec and tslime.vim | |
| # Add the following to .vimrc: | |
| let g:rspec_command = 'call Send_to_Tmux("rspec {spec}\n")' | |
| " vim-rspec mappings |
| Add to Gemfile: | |
| gem 'capybara-screenshot' | |
| Add to spec or rails helper: | |
| require 'capybara-screenshot/rspec' | |
| screenshot_and_save_page # similar to save_and_open_page but image instead of html page |
| For WebKit: | |
| page.accept_confirm { click_button "Upgrade" } | |
| For Selenium: | |
| page.driver.browser.switch_to.alert.accept |
| https://github.com/jimeh/git-aware-prompt | |
| # in my bash_profile: | |
| export GITAWAREPROMPT=~/.bash/git-aware-prompt | |
| source "${GITAWAREPROMPT}/main.sh" | |
| export PS1="\u@\h \w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ " |
| # If you want to add a comment to all files with an extension (e.g. ".rb"): | |
| find . -maxdepth 1 -type f -name "*.rb" -exec sed -i '1i #comment' {} \; | |
| # And recursive: | |
| find . -type f -name "*.rb" -exec sed -i '1i #comment' {} \; |
| https://github.com/jimeh/git-aware-prompt |
| # I had to add the following to ~/.tmux.conf: | |
| set-option -g default-command "/bin/bash -i" | |
| # http://superuser.com/questions/592610/cant-run-rails-inside-tmux-session-in-terminal |
| Add to .vimrc: | |
| nnoremap <up> <nop> | |
| nnoremap <down> <nop> | |
| nnoremap <left> <nop> | |
| nnoremap <right> <nop> | |
| inoremap <up> <nop> | |
| inoremap <down> <nop> | |
| inoremap <left> <nop> | |
| inoremap <right> <nop> |