Carl Jackson's blog
Help
- fonts.com is giving 404s, it appears their CDN is down
- How do you style a File Input? There are several jQuery plugins that do this, one that worked well (and includes drag & drop support) is jQuery-File-Upload
- Selenium + Webrat, oh my: If you try adding selenium tests to an existing test suite you may find that your test database data gets blown away. A good solution to this is to separate your selenium tests into another test suite and run them separately
Interesting
- assert_template is just doing a regex, which means that it may incorrectly be passing if you are asserting on a string that is a substring of the actual template name you expect
Interesting things
Until yesterday rvm had bugs with double slashes in paths when doing an automatic install of a specific ruby when you cd to a directory. Grab the latest off github if you need this fix.
Updating Bundler 1.0.10 may result in parse errors if your yaml contains symbols. See this post for details: https://rails.lighthouseapp.com/projects/8994/tickets/6354-psych-does-not-handle-symbols- and try this in your
config/boot.rb:
require 'yaml' YAML::ENGINE.yamler= 'syck'
autofocusattribute +hovercss rule in WebKit may not play nicely with each other
Interesting Things
All strategies that inherit from Devise::Strategies::Authenticatable (which may be all right now) check for user.active?. To deactivate a user, just add an active column to User model, and a message to present with inactive_message:
# User model def active? !!active end def inactive_message "Sorry, this account has been deactivated." end
and to test:
# Any session controller spec
it "should throw an error with an inactive user" do
user = Factory.create(:user, :password => "password")
user.active = false
user.save!
error = catch(:warden) do
post :create, :user => {:username => user.username, :password => "password"}
end
error[:message].should =~ /deactivated/
end
