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 'spec_helper' | |
describe 'products/_prime_purchase.html.erb' do | |
it "tries to sell the user on Prime" do | |
view.stubs(currently_viewing_subscription_product?: false) | |
view.stubs(current_user_has_active_subscription?: false) | |
view.stubs(subscription_product: stub('subscription_product', name: 'foo')) | |
render template: 'products/_prime_purchase' |
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 'benchmark' | |
class Base | |
def foo | |
true | |
end | |
end | |
class Implicit < Base | |
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
module TaxCodeStrategies | |
class UnitedStates | |
def call(id) | |
"US-#{id}" | |
end | |
end | |
class Brazil | |
def call(id) | |
"#{id}-BR" |
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
Factory.define :gallery do |f| | |
f.name "Gallery Name" | |
end | |
Factory.define :region do |f| | |
f.name "Telugu" | |
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
Factory.define(:estimate_with_items) do |f| | |
# ... | |
f.passing(true).ignore | |
f.after_create do |e| | |
e.items << Factory(:estimate_item, :estimate => e, :inspection => true, :op => Factory(:inspection_op, :dealer => e.dealer)).tap do |item| | |
inspection = item.inspections.first | |
location = inspection.locations.first | |
outcome = inspection.failures.detect { |outcome| outcome.performed == passing } | |
location.create_data!(:inspection_failure_id => outcome.id, :created_by => 'factory') |
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
notify_deploy_environments = %w(staging production) | |
notify_deploy_roles = %w(solo app_master) | |
if notify_deploy_environments.include?(@configuration[:environment]) && notify_deploy_roles.include?(node['instance_role']) | |
# Notify Hoptoad of deploy | |
run "cd #{release_path} && rake hoptoad:deploy TO=#{@configuration[:environment]} REVISION=#{@configuration[:revision]} REPO=#{@configuration[:repository]}" | |
end |