This file contains hidden or 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
# Note: This does not yet align 100% with out of the box devise. I will work on that. | |
Feature: Authentication | |
In order to protect my assets stored within a system | |
As any user | |
I would like to be verified as the rightful owner of those assets through authentication | |
Scenario: No authenticated user within the system | |
Given a user exists with email: "[email protected]" | |
And I am not authenticated |
This file contains hidden or 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
load "deploy" if respond_to?(:namespace) # cap2 differentiator | |
DEPLOYMENT_CONFIG = YAML.load_file("./config/config.yml")["production"] | |
# Ref: https://github.com/capistrano/capistrano/issues/81#issuecomment-1994285 | |
require "bundler/capistrano" | |
# Uncomment if you are using Rails' asset pipeline | |
load "deploy/assets" |
This file contains hidden or 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
namespace :deploy do | |
desc 'Bundle and minify the JS and CSS files' | |
task :precache_assets, :roles => :app do | |
root_path = File.expand_path(File.dirname(__FILE__) + '/..') | |
jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first | |
yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first | |
assets_path = "#{root_path}/public/assets" | |
# Precaching assets | |
run_locally "ruby -I#{yui_lib_path} #{jammit_path}" |
This file contains hidden or 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
# allow_mass_assignment_of matcher | |
# Extracted from Shoulda | |
# Works with Mongoid | |
module RSpec | |
module Matchers | |
# Ensures that the attribute can be set on mass update. | |
# | |
# it { should_not allow_mass_assignment_of(:password) } |
This file contains hidden or 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
module CanCan | |
class Query | |
def sanitize_sql(conditions) | |
conditions | |
end | |
end | |
# customize to handle Mongoid queries in ability definitions conditions | |
class CanDefinition | |
def matches_conditions_hash?(subject, conditions = @conditions) |
This file contains hidden or 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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
This file contains hidden or 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
# Application Generator Template | |
# Devise, Cucumber, RSpec... for use with Rails 3 | |
# http://gist.github.com/513564 | |
# Based on the Mongoid/Devise template: http://github.com/fortuity/rails3-mongoid-devise/raw/master/template.rb | |
# | |
# | |
# Installs my js_lib rakefile, found: http://gist.github.com/raw/628715/js_lib.rake | |
# (to keep js libraries out of source control.) | |
# | |
# Usage: |
This file contains hidden or 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
user app; | |
worker_processes 2; | |
error_log /home/app/logs/nginx.error.log info; | |
events { | |
worker_connections 1024; | |
} | |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# | |
# sprockets watch | |
# ------------------------------------------------------ | |
# inspired by Compass from Chris Eppstein | |
# minify and concat code from Mark Story | |
# put together by Kjell Bublitz | |
# using Sprockets! | |
# | |
# sources: |