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
# /spec/support/database_cleaner.rb | |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.strategy = :truncation | |
end | |
config.before(:each) do | |
DatabaseCleaner.start | |
end |
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 | |
-color | |
--require spec_helper | |
--format documentation | |
.pryrc | |
require 'hirb' | |
Hirb.enable({:width => 155, :height => 500}) |
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
require 'simplecov' | |
SimpleCov.start 'rails' | |
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require 'spec_helper' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
# Requires supporting ruby files with custom matchers and macros, etc, in |
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
source 'https://rubygems.org' | |
ruby '2.1.2' | |
gem 'rails', '4.1.4' | |
gem 'sass-rails', '~> 4.0.3' | |
gem 'uglifier', '>= 1.3.0' | |
gem 'coffee-rails', '~> 4.0.0' | |
gem 'jquery-rails' | |
gem 'jbuilder', '~> 2.0' |
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
Feature: Registration | |
Scenario: User provides valid information | |
Given a unique email, password and matching password confirmation | |
When the user clicks the Sign up button | |
Then the output should be "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." | |
Scenario: User supplies email, but no password | |
Given a unique email, but no password or password confirmation | |
When the user clicks the Sign up button |
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
require 'csv' | |
equip_dom = "/tmp/equip.db_new" | |
equip_mow = "/tmp/equip.db.mow_new" | |
namespace :oob_export do | |
task :domestic => :environment do | |
puts "Building equip.db file." | |
CSV.open(equip_dom, 'w+', col_sep: ':') do |csv| | |
Baytech.where(region: "USA").all.each do |baytech| |
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
AWS_ACCESS_KEY_ID: "XXXXXXXXXXXXXXXXXXXXX" | |
AWS_SECRET_ACCESS_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
development: | |
SENDGRID_USERNAME: "yourappname@heroku.com" | |
SENDGRID_PASSWORD: "yourPW" | |
AWS_BUCKET: myname-bloccit-dev | |
production: | |
AWS_BUCKET: myname-bloccit-prod |
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
mkdir app/controllers/topics/ | |
mv app/controllers/posts_controller.rb app/controllers/topics/posts_controller.rb | |
mkdir app/views/topics/posts/ | |
mv app/views/posts/_form.html.erb app/views/topics/posts/_form.html.erb | |
mv app/views/posts/edit.html.erb app/views/topics/posts/edit.html.erb | |
mv app/views/posts/new.html.erb app/views/topics/posts/new.html.erb | |
mv app/views/posts/show.html.erb app/views/topics/posts/show.html.erb |
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
class String | |
def title_case | |
articles = ["of", "and", "the", "a"] | |
s = self.downcase | |
a = s.split(' ') | |
a.each do |i| | |
i.capitalize! unless articles.include? i | |
end | |
a.first.capitalize! |
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
require 'csv' | |
baytechs_file = "/path/to/file/baytechs.CSV" | |
devices_file = "/path/to/file/devices.CSV" | |
namespace :oob_import do | |
task :baytechs => :environment do | |
Baytech.delete_all | |
CSV.foreach(baytechs_file, headers: true) do |row| | |
p row |