Archive for the ‘Programming’ Category

Discover your missing specs

Have you ever had the feeling that something was missing, but you weren’t quite sure what it was? I was looking at my code coverage the other day and thought to myself that it seemed like I was missing something. Rather than go through each file manually to see if it had an [...]

Read the rest of this entry »

Firefox Profiles

Firefox is my development browser of choice. With Firebug, Web Developer and ySlow, what more could any developer want? It is also my personal browser of choice and when I’m not developing then I don’t really need all those things, right? For personal browsing they will only slow things down. I [...]

Read the rest of this entry »

Gravatar Problems

When I switched the blog to Mephisto I had installed the Gravatar caching plugin. It seemed to be working fine prior to deployment, but once in production it was not working as expected. Today I finally tried to track down what was wrong. hopefully this will fix any problems with Gravatar images, [...]

Read the rest of this entry »

Striving for 100 percent

If it wasn’t obvious from my last two posts I’ve been doing a lot of testing. In fact, I spent almost the entire day yesterday writing tests. This got me thinking about the value of testing.
With the testing I’ve done recently, I feel like I’ve uncovered several problems that would have made it [...]

Read the rest of this entry »

Testing a helper with a block

I’ve been doing a lot of Rspec testing lately. Although I’ve been using it for a while to do BDD I realize that I have not been testing things as well as I should. Yesterday I was trying to add tests for a helper method that ensures the passed in block is only [...]

Read the rest of this entry »

Stubbing controller methods in a helper test

I hadn’t created any tests of helper methods in Rspec until last week. Doing so I found that one of my helpers was invoking the restful_authentication logged_in? method. This probably isn’t a big thing, but I was unsure how to stub the logged_in? method, that is, how to get the controller context to [...]

Read the rest of this entry »

iBug

While creating Nads I perused the source code of Firebug and noticed a directory called iBug. What lies within you ask? Why Firebug for the iPhone of course.
It seems that iBug is a small webserver that you run during development. Placing a snippet of code into the head of pages you want [...]

Read the rest of this entry »

Nads: My First Firefox Extension

Yesterday, I desired to learn more about building an extension for Firefox. It seemed like it would be something worthwhile to check out. I decided that I would try to create something small, just to see the process behind creating one and get familiar with the technologies used in the implementation of the [...]

Read the rest of this entry »

Userstamps

In my last article I talked about adding a deleted_at field to the migration timestamps method for use with acts_as_paranoid. One of the additional things I wanted to do was not only capture the timestamp information, but also the user information. This way, I can be really paranoid and see who did what [...]

Read the rest of this entry »

Migration Timestamps deleted_at Magic Field

I was recently working on a project using edge rails and saw that it supported something like what used to be called sexy migrations. Basically, you can make your migration files look a whole lot cleaner.
Before
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.column [...]

Read the rest of this entry »