In contrast to RSpec's included allow_value matcher, the attached matcher will also work on associations, which makes it ideal for testing assignable_values. Usage example describe Unit do...

...expect(unit.assignable_buildings).to contain_exactly(building, other_building) expect(unit.assignable_buildings).not_to include(unauthorized_building, nil) end ... See RSpec: Where to put custom matchers and other support code

web.archive.org

...that follows after colon and ends at the line end (and this string may include quotes): When /^I fill in "([^"]*)" with: (.*)$/ do |field, value| pending # express the regexp above with...

...We want to use `GlobalID.create` to avoid constructing a GID # ourselves, and because it includes some sanity checks as well. pluck(*columns).map do |(id, type)| klass = anonymous_classes_by...

Ruby's standard library includes a class for creating temporary directories. Similar to Tempfile it creates a unique directory name. Note: You need to use a block or take care...

Since Roadie is now in passive maintenance mode, we go with premailer: Include premailer in your Gemfile: gem 'premailer-rails' In your ApplicationMailer define the mailer layout:

...and only the mailer stylesheet) we have a separated mailer.js in webpack/packs where we include the css file für our mail styles: import '../application/stylesheets/mailer.sass' In your mailer.html.erb you can now...

...const textReplace = require('esbuild-plugin-text-replace') const esbuild = require('esbuild') esbuild.build({ ... plugins: [ textReplace({ include: /jasmine-core\/lib\/jasmine-core\/jasmine\.js$/, pattern: [ ['let jasmineRequire;', 'let jasmineRequire; const global = window;'], ], }), ], })

These are the results of the "personal tech stack survey". I've included only the most popular mentions, maybe it can help you find one or two useful tools for...

VIM plugins Vim plugins are all over the place. Some multiple mentions include fzf.vim Fuzzyfinder integration with vim, allows for quick project wide file search. ALE (Asynchronous Linting...

...observers to add icons) small file size due to in-built ability to only include the icons you use (if you use webpack 2, or another packager with tree-shaking...

const FontminPlugin = require('fontmin-webpack') environment.plugins.append( 'Fontmin', new FontminPlugin({ autodetect: true, }) ) Only include the icons you need Fontmin-webpacker works by only keeping glyphs it sees in your...

Rails includes milliseconds in Time / DateTime objects when rendering them as JSON: JSON.parse(User.last.to_json)['created_at'] #=> "2001-01-01T00:00:00.000+00:00" In RSpec you might want...

...committing, you should always check the diff of your changes so you don't include any leftovers or irrelevant/bad changes. Any time spent on that is well invested as it...

...diff or git diff --cached (to diff staged changes), you can also have Git include the changes as a comment below the commit message: git commit -v That will open...

...this should not be an issue but it turns crazy if you try to include associated models deeper than 1 level: options = params.merge(:include => { :user => :avatar }) Post.paginate options When inspecting...

...the merged params you will get something like this: { :include=> { "user" => :avatar }, :page => 23 } Here the :user symbol in the hash of inclusions turned into a "user" string.\

...extract_css: true 3. Change stylesheet_link_tag to stylesheet_pack_tag and javascript_include_tag to javascript_pack_tag 4. Replace image_tag with image_pack_tag if it...

...which parts of a library you want to import to your project. Many gems include everything because it was not possible otherwise. But now you can choose if you need...

developer.mozilla.org

...a webkitRelativePath property which lists the relative file path, starting from the selected directory (including it). Example: http://jsfiddle.net/xozvprdj/ Note that Chrome will show a confirmation prompt to make...

...HTML. As a fallback for older browsers you can use name (which won't include any path...

...these step definitions: Then /^I should not see an error$/ do (200 .. 399).should include(page.status_code) end Then /^I should see an error$/ do (400 .. 599).should include(page.status...

rewrite_options is used by the ..._path methods in the views ^ module HostEnforcementTrait Include this method in a module because we cannot yield out of define_method module InstanceMethods...

yield ensure self.asset_host = old_asset_host end end as_trait do |*args| include HostEnforcementTrait::InstanceMethods options = args.first || {} methods = options[:for] around_filter :assets_have_urls, :only => methods

...poses some risk when you render user input, since it might be feasible to include data from the local filesystem into the PDF. Therefore, the usual XSS protection techniques should...

docs.gitlab.com

Use rules to include or exclude jobs in pipelines. Rules are evaluated in order until the first match. When a match is found, the job is either included or excluded...

Recent IRB versions include a multi-line autocomplete which may be helpful to novice users but can be distracting. Cycling through options works by pressing the Tab key (as usual...

github.com

...methods. These will behave just like those you know from controller specs: module DeviseRequestSpecHelpers include Warden::Test::Helpers def sign_in(resource_or_scope, resource = nil) resource ||= resource_or_scope...

sign_in create(:user, name: 'John Doe') visit root_path expect(page).to include('John Doe...

makandra dev

...more consistent. The steps use "( not)? " now. The search via spreewald some query here includes steps with optional negation now...

...installed will not be reinstalled for the new RubyGems or Bundler. Some gems may include binaries that are turned into binstubs by RubyGems and thus implicitly rely on a certain...

...When you want to call methods from A inside B you would normally just include A into B: module B include A end Including exposes all of A's methods...

A cleaner way would be like this: module B module Outside include ::A module_function :foo end end This allows you to use B::Outside.foo or just...

There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...

blog.mastermind.dev

...very helpful to refresh my understanding of database indexes. As a small bonus, it includes a few helpful SQL oneliners like these two: Detecting unused indexes Detecting duplicate indexes