Skip to content

Instantly share code, notes, and snippets.

View itsNikolay's full-sized avatar
📈
Better then yesterday

Nikolay Ponomarev itsNikolay

📈
Better then yesterday
View GitHub Profile
@itsNikolay
itsNikolay / zsh.md
Last active August 29, 2015 14:19 — forked from tsabat/zsh.md
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
# for more info: https://gist.github.com/1120938
=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')
@itsNikolay
itsNikolay / deploy.rb
Created July 8, 2012 00:24 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn (production-ready setup)
# Capistrano configuration
#
# require 'new_relic/recipes' - Newrelic notification about deployment
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production.
# set :deploy_via, :remote_cache - fetch only latest changes during deployment
# set :normalize_asset_timestamps - no need to touch (date modification) every assets
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment)
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP
@itsNikolay
itsNikolay / address_decorator.rb
Created July 3, 2012 07:08 — forked from rozhok/address_decorator.rb
Remove billing address from Spree checkout page
Deface::Override.new(:name => "remove billing address form",
:virtual_path => "spree/checkout/_address",
:remove => "#billing[data-hook]"
)
Deface::Override.new(:name => "remove use billing address checkbox",
:virtual_path => "spree/checkout/_address",
:remove => "[data-hook='use_billing']"
)