Strong params: Raise in development if unpermitted params are found
...to :log or :raise to enable. The default value is :log in development and test environments, and false in all other environments. Rails 3: If you include the strong_params...
Collection of Rails development boosting frameworks
...your development environment and lets you select web server, template engine, unit and integration testing frameworks and more. Generate an app in minutes using an application template. With all the...
Stubbing out external services with an embedded Sinatra application
One of many useful techniques when your test suite needs to talk to a remote API...
Geordi: Choose your firefox version for cuc
Geordi 0.16+ supports running selenium tests with project-specific firefox versions. Just update the gem. It will still default to using the old 5.0.1 firefox. If you want another one...
Raise when there's a I18n translation missing
...handler. The attached initializer makes I18n just raise any exception (in a development or test environment...
Rails: Disable options of a select field
...see Cucumber: Check if a select field contains a disabled option on how to test this...
Consul 0.9 lets you optimize records checks
...What Consul does internally is fetch all the IDs of the power.posts scope and test if the given record's ID is among them. This list of IDs is cached...
ActionView::Template::Error (dump format error for symbol(0x6d))
I recently encountered the error above when I was running selenium tests. Thanks to a post on stackoverflow I found out that clearing all files in tmp/cache in my project...
News flash: Absolute CSS positioning on opposite sides is not a problem
...and use it. It's long overdue! ;) You can find the example that I tested on jsFiddle...
Browsers will not send a referrer when linking from HTTPS to HTTP
...linking from HTTPS to HTTPS. Fixes Tunnel links through a non-HTTPS page (but test the effect because HTTP referers survive a 301 redirect) There's a new tag you...
Selenium: How to close another tab (popup)
If you open a pop-up window [1] in your Selenium tests and you want to close it, you can do this: # Find our target window handle = page.driver.find_window("My...
How to silence UTF-8 warnings on Rails 2.3 with Ruby 1.9
Since we're using RSpec on most projects, I've transformed the test for it to a spec. See the attached link...
Capturing signatures on a touch device
self.image = image end end Credits for image generation code go to Phil Hofmann. Testing I use the following cucumber step to sign the form. Put the attached file into...
How to fix: Microphone recording levels are too quiet (or get lowered automatically)
...If you have more than one recording device, find the correct one. Make a test call to a colleague that can tell you if it's too loud or too...
Edge Rider: Power tools for ActiveRecord scopes
In our continued quest to extract proven code snippets from makandropedia into tested and upgradable gems, we have released Edge Rider. Edge Rider was created with two intents:
Prism.js: simple, fast and lightweight syntax highlighting
...modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands...
Autoplay HTML5 audio in Chrome for Android, Mobile Safari in iOS
...further sounds without user interaction by changing the source on the same element. I tested this on Chrome for Android. The interweb says it should work on Mobile Safari as...
randym/axlsx · GitHub
...If you want to open XLSX spreadsheets (for example to confirm your output in tests), you can use roo. To easily dump Rails records to XLSX, there is also axlsx...
Performance analysis of MySQL's FULLTEXT indexes and LIKE queries for full text search
...While the FULLTEXT approach was many times faster than the LIKE approach in my tests, both approaches seem to scale linearly with the number of records. For a typical web...
Force absolute URLs for parts of a view or controller
...of a view (or controller) logic. Here is how. Note: this has only been tested on a Rails 2 application. It should work similarly for Rails 3.
How to set the default monospace font on Xfce (Xubuntu)
While you can set your own font in your terminal or other tools, it will not change the default "Monospace...
Cucumber pitfall: "Around" does not apply to your "Background" steps
Details Consider this Cucumber feature file: Feature: Something that needs to be tested Background: Given a user And I sign in Scenario: Sign out When I sign out...
mattheworiordan/capybara-screenshot
Takes a screenshot when you call it, or when a test fails...
Silencing Your Staging Environment - The Hashrocket Blog
Testing with real live production data does come with at least one catch. All those real live users in your production environment have real live email addresses that receive real...