jamesconroyfinn.com

Tweets longer than 140 characters

Spoofing Remote Addresses in Tests

| Comments

In the process of testing some custom error handling I found myself needing to fake my remote address when visiting pages with Capybara and Rack::Test.

To do this I had to delve in to the internals of Rack::Test using the following Cucumber step.

1
2
3
4
5
Given /^I send requests from a remote address$/ do
  page.driver.browser.current_session.instance_eval {
    @headers['REMOTE_ADDR'] = '10.0.1.1'
  }
end

The reason this is necessary is that Rack::Test does not expose the REMOTE_ADDR header, instead always setting the value to 127.0.0.1.

Hello Octopress

| Comments

In case you haven’t heard of Octopress, it’s a fantastic static-site generator built on top of Jekyll.

I’ve been using Jekyll to build jamesconroyfinn.com for sometime now and have been tickering with styles, layouts and features all along. Now with Octopress I feel like I’ve reached a point where I’m satisfied with the list of features, and the look of the site as a whole.

Please Do REST Right

| Comments

I recently received an email from a large email delivery company bragging about a great new RESTful API, which got me quite excited because their current offering is pretty poor.

Javascript Garden

| Comments

I’ve mentioned this site to a few people in the last few days but couldn’t remember the exact URL. Turns out it’s not as simple as googling “github javascript advanced” so here’s a direct link.

Bonsaiden’s Javascript Garden