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
# =================================================================================================================== | |
# Template for generating a no-frills Rails application with support for Elasticsearch full-text search via Tire | |
# =================================================================================================================== | |
# | |
# This file creates a basic, fully working Rails application with support for Elasticsearch full-text search | |
# via the Tire gem [http://github.com/karmi/tire]. | |
# | |
# You DON'T NEED ELASTICSEARCH INSTALLED, it is installed and launched automatically by this script. | |
# | |
# Requirements |
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/tasks/minitest.rake | |
require "rake/testtask" | |
Rake::TestTask.new(:test => "db:test:prepare") do |t| | |
t.libs << "test" | |
t.pattern = "test/**/*_test.rb" | |
end | |
task :default => :test |
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
ENV['RAILS_ENV'] = 'test' | |
require File.expand_path('../dummy/config/environment.rb', __FILE__) | |
require 'rails/test_help' | |
require 'minitest/autorun' | |
require 'minitest/spec' | |
require 'minitest/mock' | |
require 'capybara/rails' | |
require 'valid_attribute' | |
require 'debugger' |
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
# Friday run sheet for Sydney workshop | |
-------------------------------------------------- | |
## 5:00 | |
Setup | |
- Eventbrite registration setup | |
- Name badges | |
- Setup projector screen | |
- Ensure wifi is working | |
- Setup sponsor banners |
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
#! /usr/bin/env ruby | |
require 'minitest/autorun' | |
require 'minitest/spec' | |
class Letters | |
WORDS = %w.cat bat bath baths. | |
attr_accessor :letters |
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
# Minitest examples | |
# wishful | |
describe Person do | |
describe 'indirect' do | |
subject { Person.new({pet: true}) } | |
it { must_be :pet? } | |
end | |
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
FactoryGirl.define do | |
sequence :first_name { |n| "John #{n}" } | |
sequence :email { |n| "john#{n}@example.com" } | |
factory :employee do | |
first_name { generate(:first_name) } | |
last_name 'Smith' | |
email { generate(:email) } |
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 "json" | |
require "net/http" | |
class DataRetriever | |
include ActiveModel::Model | |
attr_reader :search_param, :search_by_id | |
def get_data(search_param, options = {}) | |
@search_by_id = options.fetch([:search_by_id], false) | |
@search_info = search_info |
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
# migration | |
t.integer :sequence | |
# controller action | |
# and the way we've done the method, it's probably logical to put the action in test_scenarios_controller | |
def sequence | |
TestScenario.sequence=(params[:sequence]) | |
render :json => { :status => :ok } | |
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
# This controller returns static pages | |
class PagesController < ApplicationController | |
end | |
# routes.rb | |
get "help", to: "pages#help" | |
get "about", to: "pages#about" | |
get "privacy", to: "pages#privacy" | |
# ApplicationController: |