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
# 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 |
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
/** | |
* Letterpress text Fx | |
* Issue: text shadow need to go on inside. | |
*/ | |
@import url(http://fonts.googleapis.com/css?family=Monofett|Crushed|Voces|Quattrocento|Open+Sans|Play|Yanone+Kaffeesatz|Carrois+Gothic+SC|Zeyada|Covered+By+Your+Grace|Allura); | |
body { | |
text-align:center; | |
background: url(http://www.midwinter-dg.com/blog_demos/css-text-shadows/images/letterpress.gif) repeat; |
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
/** | |
* Letterpress text Fx | |
* Issue: text shadow need to go on inside. | |
*/ | |
@font-face { | |
font-family: 'LeagueGothicRegular'; | |
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.eot'); | |
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.eot?iefix') format('eot'), | |
url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.woff') format('woff'), |
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
# Navigating | |
visit '/projects' | |
visit post_comments_path(@post) | |
# Clicking links and buttons | |
click_link 'id_of_link' | |
click_link 'Link Text' | |
click_button 'Save' |
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
# in your code | |
binding.pry | |
# pry console | |
require 'factory_girl' | |
require 'spree/testing_support/factories' # spree core factories | |
FactoryGirl.find_definitions # extension factories | |
# orders | |
FactoryGirl.create :order_with_totals |
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
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' } |
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
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 | |
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
# 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 |
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
# 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). |