Github
Alternative: Bitbucket, git (private server)
None
# compact version from: https://github.com/spree/spree/blob/master/core/lib/spree/testing_support/capybara_ext.rb | |
# just drop file in spec/support | |
module CapybaraHelper | |
def select2_select(value, options) | |
find("#s2id_#{options[:from]} a").click | |
within(:xpath, '//body') do | |
find('div.select2-result-label', text: %r{#{Regexp.escape(value)}}i).click | |
end | |
end | |
end |
#!/bin/sh | |
# if cronjob junk .local mailbox | |
delete 1-10 | |
q |
module YourGem | |
# Returns the version of the currently loaded YourGem as a <tt>Gem::Version</tt> | |
def self.version | |
Gem::Version.new VERSION::STRING | |
end | |
module VERSION | |
MAJOR = 1 | |
MINOR = 1 |
class HardWorker | |
include Sidekiq::Worker | |
include Sidetiq::Schedulable | |
recurrence { hourly } | |
def perform | |
# Do some work | |
end | |
end |
# updated from the original @ http://cheat.errtheblog.com/s/rspec_shoulda | |
# just a subset -- models -- is included here. I'll update this, and create cheat sheets for others, as I go along. | |
# I marked the ones I added with NEW and also added the links to the corresponding code, as I think it's useful. | |
# Any comments/corrections are welcome! | |
# ================= Data and Associations ======================= | |
# https://github.com/thoughtbot/shoulda-matchers/tree/master/lib/shoulda/matchers/active_record | |
it { is_expected.not_to have_db_column(:admin).of_type(:boolean) } | |
it { is_expected.to have_db_column(:salary). |
# TODO: Your gem name | |
[![Gem Version][GV img]][Gem Version] | |
[![Build Status][BS img]][Build Status] | |
[![Dependency Status][DS img]][Dependency Status] | |
[![Code Climate][CC img]][Code Climate] | |
[![Coverage Status][CS img]][Coverage Status] | |
## Description |
Spree.config do |config| | |
# Amazon S3 | |
config.use_s3 = true | |
config.s3_bucket = 'mybucket' | |
config.s3_access_key = ENV['S3_ACCESS_KEY_ID'] | |
config.s3_secret = ENV['S3_SECRET_ACCESS_KEY'] | |
config.attachment_url = ':s3_eu_url' | |
config.s3_host_alias = 's3-eu-west-1.amazonaws.com' # EU | |
RSpec.describe 'locale:' do | |
Dir.glob('config/locales/*.yml') do |locale_file| | |
context locale_file do | |
it { is_expected.to be_parseable } | |
it { is_expected.to have_valid_pluralization_keys } | |
it { is_expected.not_to have_missing_pluralization_keys } | |
it { is_expected.to have_one_top_level_namespace } | |
it { is_expected.not_to have_legacy_interpolations } | |
it { is_expected.to have_a_valid_locale } | |
it { is_expected.to be_a_complete_translation_of 'config/locales/en.yml' } |