Skip to content

Instantly share code, notes, and snippets.

View dlikhten's full-sized avatar

Dmitriy "Dima" Likhten dlikhten

View GitHub Profile
@dlikhten
dlikhten / gist:3954294
Created October 25, 2012 17:49
Fun with capybara visit paths and domains.
In capybara tests, I get the following situations:
js - enabled tests
visit "/" - domain = localhost
visit "/agent" - domain = 127.0.0.1
js - disabled tests
visit "/" - domain = localhost
@dlikhten
dlikhten / password_controller.rb
Created February 7, 2013 21:32
So the problem here is after successfully doing the create action, the redirect (which takes you to "thanks") will render as text/plain not text/html. And only if the .popup format is used. And only after a failed login. The server never again replies correctly with text/html until it is restarted.
class PasswordsController < Devise::PasswordsController
caches_page :thanks
layout "floating_box"
skip_before_filter :require_active
before_filter :require_password_token, only: :edit
before_filter :load_reset_resource, only: :edit
before_filter :require_reset_resource, only: :edit
respond_to :html, :popup, only: [:new, :create, :thanks]
@dlikhten
dlikhten / evi.js
Last active August 29, 2015 14:01
window.alert();