This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo service nginx start | |
sudo service nginx stop | |
sudo service nginx restart | |
# show configuration errors | |
nginx -c /etc/nginx/nginx.conf -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initialize repository: | |
git init | |
# Get current status: | |
git status | |
# Add file myfile.txt: | |
git add myfile.txt | |
# Commit with a message: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capistrano/setup' | |
require 'capistrano/deploy' | |
require 'capistrano/rvm' | |
require 'capistrano/bundler' | |
require 'capistrano/rails/migrations' | |
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r } | |
Dir.glob('lib/capistrano/**/*.rb').each { |r| import r } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. . . | |
group :test do | |
gem 'cucumber-rails', '1.4.1', :require => false | |
gem 'json_spec', '1.1.2' | |
. . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository -y ppa:videolan/stable-daily | |
sudo add-apt-repository -y ppa:otto-kesselgulasch/gimp | |
sudo add-apt-repository -y ppa:gnome3-team/gnome3 | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo add-apt-repository -y ppa:webupd8team/y-ppa-manager | |
sudo add-apt-repository -y ppa:atareao/atareao | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get dist-upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'devise', '3.2.4' | |
gem 'simple_token_authentication', '1.5.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/api_constraints.rb | |
class ApiConstraints | |
def initialize(options) | |
@version = options[:version] | |
@default = options[:default] | |
@domain = options[:domain] | |
end | |
def matches?(req) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/jayzes/cucumber-api-steps | |
# https://gist.github.com/gonzalo-bulnes/7069339 | |
# http://anthonyeden.com/2013/07/10/testing-rest-apis-with-cucumber-and-rack.html | |
# http://vimeo.com/30586709 | |
Given /^I send and accept HTML$/ do | |
header 'Accept', "text/html" | |
header 'Content-Type', "application/x-www-form-urlencoded" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# features/step_definitions/api_steps.rb | |
# These steps are very deeply inspired in the Anthony Eden (@aeden) API steps. | |
# See http://vimeo.com/30586709 | |
# Given | |
Given /^I send and accept JSON$/ do | |
header 'Accept', 'application/json' |
NewerOlder