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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
| # colorscheme completion | |
| compctl -g '~/colors/*(:t)' colorscheme |
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
| # find a cell based on the _exact_ text in the column, and a row that | |
| # _contains_ the row text. | |
| def within_cell column, row | |
| col_eq = "text()='#{column}'" | |
| col_index = "count(//table//td[#{col_eq}]/preceding-sibling::*) + 1" | |
| row_matches = "..//td/text()[contains(., '#{row}')]" | |
| within(:xpath, "//table//td[#{col_index}][#{row_matches}]") { yield } | |
| 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
| #!/bin/bash | |
| ahead=`git log $2..$1 --pretty=oneline | wc -l` | |
| behind=`git log $1..$2 --pretty=oneline | wc -l` | |
| echo "$1 ahead $ahead commits, behind $behind commits, of $2" |
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
| λ ~/src/solidus/ refactor/fix-invalid-factories* ag "(create|build).?:adjustment[, )](.|\n)*?\)" -G "spec.rb$" -o | |
| core/spec/models/spree/order/adjustments_spec.rb | |
| 16:create(:adjustment, amount: -line_item.amount, label: "Promotion", adjustable: line_item, order: persisted_order) | |
| core/spec/models/spree/order_updater_spec.rb | |
| 47:create(:adjustment, source: promotion_action, adjustable: order, order: order) | |
| core/spec/models/spree/item_adjustments_spec.rb | |
| 13:create(:adjustment, order: order, source: tax_rate, adjustable: line_item) | |
| 41:create(:adjustment, order: order, source: promotion_action, adjustable: line_item) |
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_relative "./communications" | |
| module Spree | |
| module Adyen | |
| module Presenters | |
| # Factory for creating communication presenters, based on a payment | |
| # source. | |
| class Communication < SimpleDelegator | |
| def self.from_source source | |
| ([source] + source.notifications + source.payment.log_entries). |
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 Spree::Gateway::AdyenHPPBogus < Spree::Gateway::AdyenHPP | |
| preference :success, :bool, default: true | |
| def method_type | |
| "Adyen Bogus" | |
| end | |
| def provider | |
| raise "Adyen Hpp Bogus has no provider" | |
| 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
| require 'spec_helper' | |
| RSpec.describe Spree::Adyen::NotificationProcessing do | |
| describe "#find_payment" do | |
| context "when it is a normal event" do | |
| it "finds the payment by original reference" | |
| end | |
| context "when it is a modification event" do | |
| it "finds the payment by psp reference" |
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
| #!/usr/bin/env ruby | |
| require "bundler/setup" | |
| require "capybara" | |
| require 'capybara' | |
| require 'capybara/dsl' | |
| require 'capybara/poltergeist' | |
| require "pry" | |
| Capybara.default_driver = :poltergeist |
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 "spec_helper" | |
| describe Spree::PaypalController do | |
| # Regression tests for #55 | |
| context "when current_order is nil" do | |
| before do | |
| controller.stub :current_order => nil | |
| controller.stub :current_spree_user => nil | |
| end |