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 'action_controller/railtie' | |
require 'minitest/autorun' | |
class TestApp < Rails::Application | |
config.eager_load = false | |
config.root = File.dirname(__FILE__) | |
config.session_store :cookie_store, key: 'session' | |
config.secret_key_base = 'secret' | |
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
NoFormatTest::Application.routes.draw do | |
root 'root#index' | |
scope '/foo/:bar', format: false, bar: /[^\/\?]+/ do | |
get '/', to: 'root#index' | |
get '/baz', to: 'root#index' | |
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
# Must have mysql installed with database 'activerecord_unittest' and user 'rails' | |
unless File.exists?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'mysql2' | |
GEMFILE | |
system 'bundle' |
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 ArrayCoder | |
def initialize(default = []) | |
@default = default | |
end | |
def dump(object) | |
Array(object).join(',') | |
end | |
def load(string) |
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
def maps_url(options = {}) | |
options = options.dup | |
options.assert_valid_keys(:lat, :lng, :zoom, :width, :height) | |
options[:size] = “#{options.delete(:width)}x#{options.delete(:height)}” | |
options[:center] = “#{options.delete(:lat)},#{options.delete(:lng)}” | |
“http://maps.google.com/?#{options.to_query}” | |
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
require 'active_record' | |
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:") | |
ActiveRecord::Schema.define(:version => 1) do | |
create_table :posts do |t| | |
t.string :title | |
t.timestamps | |
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
class TestSanitizer < ActiveModel::MassAssignmentSecurity::Sanitizer | |
def sanitize(klass, attributes, authorizer) | |
attributes | |
end | |
end | |
ActiveRecord::Base.mass_assignment_sanitizer = TestSanitizer.new | |
it "creates a model" do | |
Model.should_receive(:create).with(:name => "Foo Bar") |
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
diff --git a/public/wp-content/plugins/woocommerce-shipping-table-rate/shipping-table-rate.php b/public/wp-content/plugins/woocommerce-shipping-table-rate/shipping-table-rate.php | |
index 8a7e082..01f5e47 100644 | |
--- a/public/wp-content/plugins/woocommerce-shipping-table-rate/shipping-table-rate.php | |
+++ b/public/wp-content/plugins/woocommerce-shipping-table-rate/shipping-table-rate.php | |
@@ -242,6 +242,7 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g | |
<th class="country"><?php _e('Destination countries/states', 'wc_table_rate'); ?></th> | |
<th><?php _e('Postcode', 'wc_table_rate'); ?> <a class="tips" tip="<?php _e('(optional) Comma separated list of ZIPs/Postcodes. Accepts wildcards, e.g. P* will match a postcode of PE30.', 'wc_table_rate'); ?>">[?]</a></th> | |
<th><?php _e('Exclude Postcode', 'wc_table_rate'); ?> <a class="tips" tip="<?php _e('(optional) Comma separated list of ZIPs/Postcodes to EXCLUDE. Accepts wildcards, e |
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
body.mediawiki > div:not(.suggestions) { display: block !important; } | |
body.mediawiki > #mw-sopaOverlay { display: none !important; } |
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
traceroute to api.authorize.net (64.94.118.84), 30 hops max, 60 byte packets | |
1 212-74-42-254.static.alvechurch.core.datatechuk.net (212.74.42.254) 0.882 ms 1.469 ms 1.863 ms | |
2 peer-gi1-1.alvechurch.core.datatechuk.net (212.74.63.252) 1.637 ms 2.032 ms 2.218 ms | |
3 perr-geam-1a-ge340.network.virginmedia.net (82.36.0.213) 2.684 ms 3.129 ms 3.279 ms | |
4 perr-core-1a-ae0-0.network.virginmedia.net (62.255.149.133) 2.829 ms 3.162 ms 3.331 ms | |
5 manc-bb-1a-as1-0.network.virginmedia.net (213.105.175.181) 6.378 ms 7.119 ms 7.035 ms | |
6 brnt-bb-1b-ae1-0.network.virginmedia.net (212.43.163.86) 13.030 ms 10.798 ms 10.472 ms | |
7 brnt-tmr-1-ae5-0.network.virginmedia.net (213.105.159.50) 10.968 ms 11.101 ms 11.035 ms | |
8 telc-ic-1-as0-0.network.virginmedia.net (62.253.185.74) 12.460 ms 13.297 ms 13.325 ms | |
9 ldn-b2-link.telia.net (213.248.100.97) 12.615 ms 12.804 ms 13.058 ms |