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 "codeclimate-test-reporter" | |
branch = ENV['CIRCLE_BRANCH'] | |
node_index = ENV['CIRCLE_NODE_INDEX'].to_i | |
node_total = ENV['CIRCLE_NODE_TOTAL'].to_i | |
artifacts_dir = ENV['CIRCLE_ARTIFACTS'] | |
coverage_dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage") | |
filename = '.resultset.json' |
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
# in template | |
<%= form_tag subscription_path, id: 'payment-form' %> | |
<script> | |
$(function() { | |
var handler = StripeCheckout.configure({ | |
key: "<%= Rails.configuration.stripe[:publishable_key] %>", | |
token: function(token, args) { | |
var form = $("#payment-form"); | |
form.append("<input type='hidden' name='stripe_token' value='" + JSON.stringify(token) + "'/>"); |
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
# Prevent calls from going out to elasticsearch unless we specify the example is an elasticsearch test | |
config.before :each do | |
unless (example.metadata[:elasticsearch] && example.metadata[:elasticsearch] == true) | |
stub_request(:any, %r|\Ahttp://.*9200.*|).to_return(:status => 200, :body => "{}") | |
end | |
end | |
config.before :each, elasticsearch: true do | |
[Product, User].each do |klass| | |
klass.index.delete |
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
class BaseJob | |
def queue | |
:queue | |
end | |
def perform(klass, method, *args) | |
klass.constantize.send(method, *args) | |
end | |
end |