Strong params: Raise in development if unpermitted params are found

Posted About 10 years ago by Thomas Klemm.
guides.rubyonrails.org

...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

Posted About 10 years ago by Dominik Schöler.

...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

Posted Over 10 years ago by Henning Koch.
robots.thoughtbot.com

One of many useful techniques when your test suite needs to talk to a remote API...

Geordi: Choose your firefox version for cuc

Posted Over 10 years ago by Tobias Kraze.

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

Posted Over 10 years ago by Dominik Schöler.

...handler. The attached initializer makes I18n just raise any exception (in a development or test environment...

Rails: Disable options of a select field

Posted Almost 11 years ago by Dominik Schöler.

...see Cucumber: Check if a select field contains a disabled option on how to test this...

Consul 0.9 lets you optimize records checks

Posted Almost 11 years ago by Henning Koch.

...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))

Posted Almost 11 years ago by Andreas Robecke.

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

Posted About 11 years ago by Arne Hartherz.

...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

Posted About 11 years ago by Henning Koch.

...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)

Posted About 11 years ago by Arne Hartherz.

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

Posted About 11 years ago by Arne Hartherz.
gist.github.com

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

Posted About 11 years ago by Tobias Kraze.

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)

Posted About 11 years ago by Arne Hartherz.

...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

Posted Over 11 years ago by Henning Koch.

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

Posted Over 11 years ago by Dominik Schöler.
prismjs.com

...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

Posted Over 11 years ago by Henning Koch.

...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

Posted Over 11 years ago by Arne Hartherz.
github.com

...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

Posted Over 11 years ago by Henning Koch.

...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

Posted Over 11 years ago by Arne Hartherz.

...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)

Posted Over 11 years ago by Arne Hartherz.
perlstalker.vuser.org

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

Posted Over 11 years ago by Arne Hartherz.

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

Posted Over 11 years ago by Henning Koch.
github.com

Takes a screenshot when you call it, or when a test fails...

Silencing Your Staging Environment - The Hashrocket Blog

Posted Almost 12 years ago by Henning Koch.
blog.hashrocket.com

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...