...making the same mistakes. To my surprise I got excellent 12 responses, which I include below along with one of my own. It is a small sample and biased by...
If your Ruby project includes a gem like Spreewald that comes with some external step definition, RubyMine does not know about them by default and will highlight the step as...
...I should get a download with the filename "([^\"]*)"$/ do |filename| page.driver.response.headers['Content-Disposition'].should include("filename=\"#{filename}\"") end Webrat Then /^I should get a download with the filename "([^\"]*)"$/ do |filename...
...response.headers['Content-Disposition'].should include("filename=\"#{filename}\"")
...If you want to allow setting #id on .new, .create or create! you can include the attached module in order to whitelist #id on a model of your choice like...
class MyModel < ActiveRecord::Base include AllowSettingIdOnCreate end Note that your controllers should always whitelist the attributes they set on model records...
group :cucumber do ... gem 'headless' end Go to your features/support/env.rb file and include the following snippet: require 'headless' headless = Headless.new at_exit do headless.destroy end Before("@selenium,@javascript...
...token with #{Rails.env unless Rails.env.production?}. Note: There may be tokens in single quotes that include backslashes, double quotes etc. You should not change this to double quotes because Ruby would...
Hint: There's another card with this helper for Cucumber features. Sometimes you feel like you need to stub some...
...to create one file per matcher in spec/support/matchers: spec/support/matchers/be_same_numbers_as.rb spec/support/matchers/be_same_second_as.rb spec/support/matchers/exist_in_database.rb spec/support/matchers/include_hash.rb You can include all matchers in the support directory by adding the following line to your spec_helper.rb:
...rendering the favicons, in all needed sizes, formats and with the HTML needed to include them! In Rails applications with Haml: put all the favicon files into /public
...development and test environments, and false in all other environments. Rails 3: If you include the strong_params gem, see the Readme for handling unpermitted keys...
Best results in other decks
module FixtureHelper def fixture_base_path Pathname.new(File.expand_path('../../../fixtures', __FILE__)) end def fixture_fake_repo_path Pathname.new(File.expand_path...
Every developer loves to individualize prompts and play around with the cool features. Or at least... I do. Here's...