06 Apr '12, 8pm

Testing a before_filter

require 'test_helper' class ApplicationControllerTest < ActionController::TestCase context 'ensure_manually_set_password' do setup do class ::TestingController < ApplicationController def hello render :nothing => true end end ActionController::Routing::Routes.draw do |map| map.hello '', :controller => 'testing', :action => 'hello' end end teardown do Object.send(:remove_const, :TestingController) end context 'when user is logged in' do setup do @controller = TestingController.new end context 'and user has not manually set their password' do setup do @user = Factory(:user, :manually_set_password => false) login_as @user get :hello end should 'redirect user to set their password' do assert_redirected_to new_password_path(@user.password_token) end end end end end

Full article: http://robots.thoughtbot.com/post/20607985282/testing-a-b...

Tweets

I have thoughts on testing your code:

smartic.us 12 Apr '12, 1pm

It’s happening again: An extremely successful software developer with a very large following lists his rules for success, ...

Do It Yourself A/B Testing

Do It Yourself A/B Testing

searchengineland.com 04 Apr '12, 4pm

I always start marketing interviews with a phone screen of some variant of the following question: “Let’s say this is your...

Compliance and conformance: testing to new #IEEE standards: via @ee_times #in

Compliance and conformance: testing to new #IEE...

eetimes.com 04 Apr '12, 12pm

Your Work Group has spent many months and thousands of man-hours developing a specification for the latest technology widg...

White Peugeot 408 with black tape testing on th...

paultan.org 10 Apr '12, 2am

Related stories you might be interested in reading: Peugeot 408 sighted again, still wearing tape Ford Fiesta facelift beg...

NST Becomes a BPI Certified Testing Center

NST Becomes a BPI Certified Testing Center

renewableenergyworld.com 06 Apr '12, 9pm

BPI field exams are becoming notoriously difficult to pass. NST is offering a special to review and retake BPI exams for b...

The Value Of Testing Website Usability & Search...

searchengineland.com 30 Mar '12, 4pm

For one day during the holiday shopping period in December, customers could not use a well-known retail giant’s website. H...

Behind The Scenes: Barista On Duty Coffee Testing Process

Behind The Scenes: Barista On Duty Coffee Testi...

dailyshotofcoffee.com 05 Apr '12, 2pm

For most roasters, the test is done by a small team of quality control employees that do regular coffee cuppings as they’r...

Konacha: JavaScript Testing on Rails

rubyflow.com 03 Apr '12, 2pm

Konacha: JavaScript Testing on Rails Posted by joliss on April 03, 2012 — 0 comments For those looking to test heavy (Back...