Skip to content

Instantly share code, notes, and snippets.

View dchapman1988's full-sized avatar

David Chapman dchapman1988

View GitHub Profile
User-agent: Googlebot
User-agent: ArchitextSpider
User-Agent: msnbot
User-Agent: yahoo-slurp
User-Agent: teoma
User-Agent: bingbot
Disallow: /*?
Disallow: /browse
Disallow: /users/
"""
License: MIT
Author: Heath Matlock
Problem: https://en.wikipedia.org/wiki/Weasel_program
"""
import string
import random
from time import time
from operator import itemgetter
require 'use_case_helper'
describe UseCase::Plan::Hotel::Create do
describe "when executed" do
before do
hotel_search_usecase_class = mock("Hotel Search UseCase Class")
hotel_search_usecase_object = mock("Hotel Search UseCase Object")
hotel_usecase_search_result = mock("Hotel Search UseCase Result")
hotel_usecase_search_data = mock("Hotel Search UseCase Data")
hotel = mock("Hotel")
require 'use_case_helper'
describe UseCase::Plan::Hotel::Create do
describe "when executed" do
before do
params = {name: nil, hotel_id: nil}
# Smaller names will help on your mocks
#
# If you get an error instead of getting something like:
named_scope :between, lambda {|start_date, end_date| {:conditions => ["residential_insurance_applications.created_at BETWEEN ? AND ?", start_date.beginning_of_day, end_date.end_of_day]} }
named_scope :before, lambda {|end_date| {:conditions => ["residential_insurance_applications.created_at < ?", end_date.end_of_day]} }
named_scope :after, lambda {|start_date| {:conditions => ["residential_insurance_applications.created_at > ?", start_date.beginning_of_day]} }
named_scope :stale, lambda { {:conditions => ["completed_at IS NULL AND updated_at < ?", DEFAULT_STALE_THRESHOLD.ago]} }
named_scope :completed, :conditions => ["completed_at IS NOT NULL"]
named_scope :uncompleted, :conditions => ["completed_at IS NULL"]
named_scope :for_agency, lambda {|agency| {:include => [{:user => [:agency]}], :conditions => ["agencies.id = ?", agency.id] } }
named_scope :for_producer, lambda {|producer| {:conditions => ["residential_insurance_applications.producer_id = ?", producer.id] } }