14 Dec '12, 2pm

Faster tests: sign in through the back door

December 14, 2012 dancroak ruby on rails testing clearance capybara Faster tests: sign in through the back door One way to make tests faster is to avoid loading and submitting the sign in form during the setup phase . This back door inserts Rack middleware into a Rails app that uses Clearance : # config/environments/test.rb class ClearanceBackDoor def initialize(app) @app = app end def call(env) @env = env sign_in_through_the_back_door @app.call(@env) end private def sign_in_through_the_back_door if user_id = params['as'] user = User.find(user_id) @env[:clearance].sign_in(user) end end def params Rack::Utils.parse_query(@env['QUERY_STRING']) end end MyRailsApp::Application.configure do # ... config.middleware.use ClearanceBackDoor # ... end Then, include a user in an as parameter in integration tests: visit root_path(as: user) It works for any URL: visit new_feedback_path(...

Full article: http://robots.thoughtbot.com/post/37907699673/faster-test...

Tweets

Arduino Keypad for Garage Door: Do you need to build a KeyPad for your system? [AverageGuy] did it himself. Here...

Arduino Keypad for Garage Door: Do you need to ...

arduino.cc 15 Dec '12, 5pm

Arduino Keypad for Garage Door Do you need to build a KeyPad for your system? [AverageGuy] did it himself. Here his story:...

A look back on 2012: Accellera: via @eetimes #E...

eetimes.com 13 Dec '12, 6pm

New SystemC Library (16 Jul 2012) - The release of version 2.3.0 SystemC open source proof-of-concept library is now avail...

25K sign petition to build Death Star: More than 25,000 individuals who live in the United

25K sign petition to build Death Star: More tha...

defensetech.org 14 Dec '12, 1am

More than 25,000 individuals who live in the United States of America took the time to sign a petition requesting the Whit...

Glowing Reviews for Facebook's Faster Android App

searchenginewatch.com 17 Dec '12, 9pm

Facebook released a native app for Android devices on Thursday, which it claims is "twice as fast" as its previous effort....

Euro survives 2012, further tests in store

Euro survives 2012, further tests in store

channelnewsasia.com 23 Dec '12, 3am

BRUSSELS: The battered euro, written off as a dud many times during a crisis-wracked year, appears to have survived 2012, ...

Schwartzel on the brink of back-to-back titles:...

pgatour.com 15 Dec '12, 6pm

Schwartzel on the brink of back-to-back titles text size Dec. 15, 2012 MALELANE, South Africa (AP) -- Charl Schwartzel pow...

오바마 캠프에서 사용하는 Ruby on Rails 앱의 성능을 향상시키려면?!

ninjasandrobots.com 17 Dec '12, 4am

Faster Rails partial rendering and caching. 78% improvement of test application Using a new gem I created, I was able to o...