Skip to content

Instantly share code, notes, and snippets.

View katranci's full-sized avatar

Ahmet Katrancı katranci

View GitHub Profile
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@katranci
katranci / a_controller_spec.rb
Created July 25, 2014 19:44
Perform basic authentication in RSpec using shared contexts
require 'spec_helper'
describe Admin::AdminPanelController do
include_context "login_as_admin"
describe "GET #index" do
it "should render the :index template" do
get :index
expect(response).to render_template(:index)