<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rob aldred &#187; Programming</title>
	<atom:link href="http://robaldred.co.uk/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://robaldred.co.uk</link>
	<description>cars, f1, bikes, tech tips &#38; what ever i&#039;m interested in this week</description>
	<lastBuildDate>Thu, 15 Apr 2010 13:54:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Adding additional configuration args to selenium rc using cucumber and webrat</title>
		<link>http://robaldred.co.uk/2010/02/adding-additional-configuration-args-to-selenium-rc-using-cucumber-and-webrat/</link>
		<comments>http://robaldred.co.uk/2010/02/adding-additional-configuration-args-to-selenium-rc-using-cucumber-and-webrat/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 14:30:50 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[webrat]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=183</guid>
		<description><![CDATA[I use cucumber, webrat and selenium RC a lot day to day, all are great pieces of kit, which make my life so much easier, but I&#8217;m always trying to find ways to make these ever easier. Selenium RC has alot of options which are settable when booting the selenium-server java application. Many of these [...]]]></description>
			<content:encoded><![CDATA[<p>I use cucumber, webrat and selenium RC a lot day to day, all are great pieces of kit, which make my life so much easier, but I&#8217;m always trying to find ways to make these ever easier.<br />
Selenium RC has alot of options which are settable when booting the selenium-server java application.<br />
Many of these options are not available when using selenium with cucumber and webrat.</p>
<p>I have <a href="https://webrat.lighthouseapp.com/projects/10503/tickets/307-ability-to-pass-additional-args-to-the-selenium-rc-server">raised an issue for webrat</a> and produced a patch that enables you to pass additional arguments during the setup of your webrat instance, these are then passed on to the Selenium RC startup command. </p>
<p>Until this is prioritised and added to the webrat core, I have an on-the-fly solution that enables the additional args, the following code should be added to your `env.rb`</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">module</span> Webrat<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">class</span> Configuration<br />
&nbsp; &nbsp; attr_accessor <span style="color:#ff3333; font-weight:bold;">:selenium_additional_args</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">module</span> AdditionalArgs &nbsp;<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">included</span><span style="color:#006600; font-weight:bold;">&#40;</span>base<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; base.<span style="color:#9900CC;">alias_method_chain</span> <span style="color:#ff3333; font-weight:bold;">:start</span>, <span style="color:#ff3333; font-weight:bold;">:additional_args</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp;<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> start_with_additional_args<br />
&nbsp; &nbsp; remote_control.<span style="color:#9900CC;">additional_args</span> = Webrat.<span style="color:#9900CC;">configuration</span>.<span style="color:#9900CC;">selenium_additional_args</span><br />
&nbsp; &nbsp; start_without_additional_args<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
Webrat.<span style="color:#9900CC;">configure</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>config<span style="color:#006600; font-weight:bold;">|</span> &nbsp;<br />
&nbsp; ... &nbsp;<br />
&nbsp; <span style="color:#9900CC;">config</span>.<span style="color:#9900CC;">selenium_additional_args</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;-firefoxProfileTemplate '../../Library/Application Support/Firefox/Profiles/selenium'&quot;</span>, <span style="color:#996600;">&quot;-singleWindow&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><br />
&nbsp; ...<br />
<span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#6666ff; font-weight:bold;">Webrat::Selenium::SeleniumRCServer</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>:<span style="color:#9966CC; font-weight:bold;">include</span>, AdditionalArgs<span style="color:#006600; font-weight:bold;">&#41;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2010/02/adding-additional-configuration-args-to-selenium-rc-using-cucumber-and-webrat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing ActionMailer models with Rspec</title>
		<link>http://robaldred.co.uk/2009/12/testing-actionmailer-models-with-rspec/</link>
		<comments>http://robaldred.co.uk/2009/12/testing-actionmailer-models-with-rspec/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 11:41:05 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[actionmailer]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=163</guid>
		<description><![CDATA[You might think testing ActionMailer sounds like a challenge, actually it&#8217;s just as easy as testing other classes, you just have to know the methods to use to change the state/content of the deliveries. Here we have a simple example of how you might test a mailer for your order receipt 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475require File.dirname&#40;__FILE__&#41; + '/../spec_helper' [...]]]></description>
			<content:encoded><![CDATA[<p>You might think testing ActionMailer sounds like a challenge, actually it&#8217;s just as easy as testing other classes, you just have to know the methods to use to change the state/content of the deliveries.</p>
<p>Here we have a simple example of how you might test a mailer for your order receipt</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br /></div></td><td><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/../spec_helper'</span><br />
<br />
describe OrderMailer <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; <br />
&nbsp; describe <span style="color:#996600;">&quot;receipt&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; <br />
&nbsp; &nbsp; before<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:each</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@order</span> = mock_model<span style="color:#006600; font-weight:bold;">&#40;</span>Order<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span> = mock_model<span style="color:#006600; font-weight:bold;">&#40;</span>Customer<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; it <span style="color:#996600;">&quot;should render successfully&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> OrderMailer.<span style="color:#9900CC;">create_receipt</span><span style="color:#006600; font-weight:bold;">&#40;</span>@order<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">should_not</span> raise_error<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; describe <span style="color:#996600;">&quot;rendered without error&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; before<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:each</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span> = OrderMailer.<span style="color:#9900CC;">create_receipt</span><span style="color:#006600; font-weight:bold;">&#40;</span>@order<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have an order number&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.order_number'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">id</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have order details&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.order_details&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have a billing address&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.billing.address&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have a delivery address&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.delivery.address&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have customer contact details&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#contact_details&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.landline'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span>.<span style="color:#9900CC;">landline</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.mobile'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span>.<span style="color:#9900CC;">mobile</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.email'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0066ff; font-weight:bold;">@order</span>.<span style="color:#9900CC;">customer</span>.<span style="color:#9900CC;">email</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have a list of items&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.line_items&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should have totals&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0066ff; font-weight:bold;">@mailer</span>.<span style="color:#9900CC;">body</span>.<span style="color:#9900CC;">should</span> have_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.totals&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.sub_total'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">sub_total</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.vat'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">vat</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.postage'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">postage</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; with_tag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'.total'</span>, <span style="color:#ff3333; font-weight:bold;">:text</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> format_price<span style="color:#006600; font-weight:bold;">&#40;</span>@order.<span style="color:#9900CC;">total</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should deliver successfully&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> OrderMailer.<span style="color:#9900CC;">deliver</span><span style="color:#006600; font-weight:bold;">&#40;</span>@mailer<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">should_not</span> raise_error<br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; describe <span style="color:#996600;">&quot;and delivered&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; it <span style="color:#996600;">&quot;should be added to the delivery queue&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">lambda</span> <span style="color:#006600; font-weight:bold;">&#123;</span> OrderMailer.<span style="color:#9900CC;">deliver</span><span style="color:#006600; font-weight:bold;">&#40;</span>@mailer<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">should</span> change<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">ActionMailer::Base</span>.<span style="color:#9900CC;">deliveries</span>,:size<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">by</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
&nbsp; <br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></td></tr></tbody></table></div>
<p>rendering the following output:</p>
<div id="attachment_176" class="wp-caption alignnone" style="width: 310px"><a href="http://robaldred.co.uk/wp-content/uploads/2009/12/Screen-shot-2009-12-14-at-11.37.58.png"><img src="http://robaldred.co.uk/wp-content/uploads/2009/12/Screen-shot-2009-12-14-at-11.37.58-300x262.png" alt="ActionMailer test output from textmate rspec bundle" title="ActionMailer test output from textmate rspec bundle" width="300" height="262" class="size-medium wp-image-176" /></a><p class="wp-caption-text">ActionMailer test output from textmate rspec bundle</p></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/12/testing-actionmailer-models-with-rspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add https (ssl) support to your osx mac development machine with signed certificate</title>
		<link>http://robaldred.co.uk/2009/11/adding-httpsssl-support-to-your-apache-mod_ssl-development-osx-mac-machine/</link>
		<comments>http://robaldred.co.uk/2009/11/adding-httpsssl-support-to-your-apache-mod_ssl-development-osx-mac-machine/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 15:07:31 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[authority]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mod_ssl]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[self-signed]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=138</guid>
		<description><![CDATA[It became apparent that getting mod_ssl working correctly without browser warnings when developing sites that take payments is a bit of pain. Mainly because there is no free way to have a root authority sign your Certificate Signing Request (CSR). There is how ever a short cut, given that you are using Apache, mod_ssl, openssl [...]]]></description>
			<content:encoded><![CDATA[<p>It became apparent that getting mod_ssl working correctly without browser warnings when developing sites that take payments is a bit of pain. Mainly because there is no free way to have a root authority sign your Certificate Signing Request (CSR).</p>
<p>There is how ever a short cut, given that you are using Apache, mod_ssl, openssl and Firefox.</p>
<p>We&#8217;re going to generate our own Certificate Authority (CA), this is CA is only going to work for us so if your generating a certificate for production, you&#8217;ll need to send your CSR to a proper CA such as VeriSign</p>
<p>Step1, Make a temporary folder we can work in.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>ssltemp</div></div>
<p>Step2, generate our private key</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> server.key <span style="color: #000000;">1024</span></div></div>
<p>You will be asked for a passphrase in the creation of this key. (just use 12345) or anything but<em>do not forget this passphrase!</em> You’ll have to do this all over if you forget the passphrase. You will need this passphrase later on in the process.</p>
<p>Step3, generate a CSR from our private  key</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-key</span> server.key <span style="color: #660033;">-out</span> server.csr</div></div>
<p>you&#8217;ll be asked for the following information:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Country Name <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span> letter code<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>AU<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter your country code here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
State or Province Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>full name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Some-State<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>Enter your state here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Locality Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, city<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter your city here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Organization Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, company<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Internet Widgits Pty Ltd<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter something here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Organizational Unit Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, section<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>enter something here<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Common Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, YOUR name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>this is the important one<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Email Address <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #7a0874; font-weight: bold;">&#40;</span>your e-mail address<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>Make sure you fill in `Common Name` with your domain you want this certificate for, this should match your apache vhost `ServerName` setting</p>
<p>Now, looking at the directory we&#8217;re working in, you should have the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>rob:~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>ssltemp<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span><br />
total <span style="color: #000000;">12</span><br />
drwxr-xr-x &nbsp; &nbsp;<span style="color: #000000;">5</span> rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">126</span> Nov <span style="color: #000000;">14</span> <span style="color: #000000;">17</span>:01 .<br />
drwx------ &nbsp; <span style="color: #000000;">38</span> rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1248</span> Nov <span style="color: #000000;">14</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">57</span> ..<br />
<span style="color: #660033;">-rw-r--r--</span> &nbsp; &nbsp;<span style="color: #000000;">1</span> rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">729</span> Nov <span style="color: #000000;">14</span> <span style="color: #000000;">17</span>:01 server.csr<br />
<span style="color: #660033;">-rw-r--r--</span> &nbsp; &nbsp;<span style="color: #000000;">1</span> rob &nbsp; &nbsp; &nbsp;staff &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">963</span> Nov <span style="color: #000000;">14</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">59</span> server.key</div></div>
<p>Step4, create the private key for our CA</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl genrsa <span style="color: #660033;">-des3</span> <span style="color: #660033;">-out</span> ca.key <span style="color: #000000;">1024</span></div></div>
<p>Again, you’ll be asked for a passphrase, which, again, you should not forget.</p>
<p>Step5, create CA certificate using the key we just made</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-x509</span> <span style="color: #660033;">-days</span> <span style="color: #000000;">365</span> <span style="color: #660033;">-key</span> ca.key <span style="color: #660033;">-out</span> ca.crt</div></div>
<p>You will be asked for similar information you were asked for when we make the web server certificate earlier; this information should be about you, enter something like the following</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Country Name <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2</span> letter code<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>AU<span style="color: #7a0874; font-weight: bold;">&#93;</span>:GB<br />
State or Province Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>full name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Some-State<span style="color: #7a0874; font-weight: bold;">&#93;</span>:Cheshire<br />
Locality Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, city<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:Stockport<br />
Organization Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, company<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>Internet Widgits Pty Ltd<span style="color: #7a0874; font-weight: bold;">&#93;</span>:My CA<br />
Organizational Unit Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, section<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:My CA <span style="color: #000000; font-weight: bold;">for</span> Dev<br />
Common Name <span style="color: #7a0874; font-weight: bold;">&#40;</span>eg, YOUR name<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:Rob Aldred<br />
Email Address <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>:raldred<span style="color: #000000; font-weight: bold;">@</span>gmail.com</div></div>
<p>Now you will have 4 files your directory; server.key, server.csr, ca.key, ca.crt<br />
Next is the important park, signing our certificate request.</p>
<p>The easiest way to do this is to use the sign.sh script contained in the mod_ssl source,<br />
or you can get it here: <a href="http://bit.ly/4MtUqX">sign.sh</a><br />
copy the script to the working directory</p>
<p>Step6, make sign.sh executable and sign our CSR</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x sign.sh<br />
.<span style="color: #000000; font-weight: bold;">/</span>sign.sh server.csr</div></div>
<p>you should get something like the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CA signing: server.csr -<span style="color: #000000; font-weight: bold;">&amp;</span>gt; server.crt:<br />
Using configuration from ca.config<br />
Enter PEM pass phrase:<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subjects Distinguished Name is <span style="color: #c20cb9; font-weight: bold;">as</span> follows<br />
countryName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :PRINTABLE:<span style="color: #ff0000;">'GB'</span><br />
stateOrProvinceName &nbsp; :PRINTABLE:<span style="color: #ff0000;">'Cheshire'</span><br />
localityName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:PRINTABLE:<span style="color: #ff0000;">'Stockport'</span><br />
organizationName &nbsp; &nbsp; &nbsp;:PRINTABLE:<span style="color: #ff0000;">'Testing'</span><br />
organizationalUnitName:PRINTABLE:<span style="color: #ff0000;">'Testing'</span><br />
commonName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:PRINTABLE:<span style="color: #ff0000;">'localhost'</span><br />
emailAddress &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:IA5STRING:<span style="color: #ff0000;">'raldred@gmail.com'</span><br />
Certificate is to be certified <span style="color: #000000; font-weight: bold;">until</span> Nov <span style="color: #000000;">14</span> <span style="color: #000000;">23</span>:09:<span style="color: #000000;">20</span> <span style="color: #000000;">2010</span> GMT <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">365</span> days<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Sign the certificate? <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span>:y<br />
<br />
<span style="color: #000000;">1</span> out of <span style="color: #000000;">1</span> certificate requests certified, commit? <span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span>y<br />
Write out database with <span style="color: #000000;">1</span> new entries<br />
Data Base Updated<br />
CA verifying: server.crt <span style="color: #000000; font-weight: bold;">&amp;</span>lt;-<span style="color: #000000; font-weight: bold;">&amp;</span>gt; CA cert<br />
server.crt: OK</div></div>
<p>Answer &#8216;y&#8217; to the question asking to Sign the certificate [y/n]</p>
<p>Step7, remove password requirement from server key</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">cp</span> server.key server.key.original<br />
openssl rsa <span style="color: #660033;">-in</span> server.key.original <span style="color: #660033;">-out</span> server.key</div></div>
<p>you be asked for the passphase</p>
<p>Step8, copy files to our webserver</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>certs<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>Step9, add the configuration to your VirtualHost block listening on the SSL port 443</p>
<div class="codecolorer-container apache twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">SSLEngine</span> <span style="color: #0000ff;">on</span><br />
<span style="color: #00007f;">SSLCertificateFile</span> <span style="color: #7f007f;">&quot;/etc/apache2/certs/server.crt&quot;</span><br />
<span style="color: #00007f;">SSLCertificateKeyFile</span> <span style="color: #7f007f;">&quot;/etc/apache2/certs/server.key&quot;</span><br />
<span style="color: #00007f;">SSLCACertificateFile</span> <span style="color: #7f007f;">&quot;/etc/apache2/certs/ca.crt&quot;</span></div></div>
<p>Step10, Tell apache to listen on 443<br />
By default there is a file in /etc/apache2/extras called httpd-ssl.conf<br />
this needs to edited and included in /etc/apache2/httpd.conf its commented out initially.</p>
<p><em>Depending where you are defining your VirtualHost blocks</em><br />
Comment out or remove the _default_ virtualHost block in httpd-ssl.conf, this will cause errors when starting apache because we have no configured certificate for the example apache provites</p>
<p>Edit your httpd.conf to include the etc/httpd-ssl.conf file, scroll to the bottom the file, you&#8217;ll notice its commented out at around line #476</p>
<div class="codecolorer-container apache twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #adadad; font-style: italic;"># Secure (SSL/TLS) connections</span><br />
<span style="color: #adadad; font-style: italic;"># Include /private/etc/apache2/extra/httpd-ssl.conf</span></div></div>
<p>Just remove the # and move onto the next step</p>
<blockquote><p><em>I use a seperate vhosts folder in extra, containing individual conf files for each virtualhost, they are included in the extra/httpd-vhosts.conf files using the following:</em></p>
<div class="codecolorer-container apache twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="apache codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00007f;">Include</span> /private/etc/apache2/extra/vhosts/*.conf</div></div>
</blockquote>
<p>Step10, restart apache</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apachectl restart</div></div>
<p>Step11, (a few steps in itself) Add our CA to Firefox so it think its a trusted authority<br />
Go to Preferences (Cmd + ,)<br />
Go to Advanced<br />
Go to Encryption<br />
Click &#8216;View Certificates&#8217;<br />
Choose the &#8216;Authorities&#8217; tab<br />
Click &#8216;Import&#8217;<br />
Hit Shift + Cmd + g to open the go to folder window<br />
Enter &#8216;/etc/apache2/certs&#8217; (You might be asked to authenticate with your system password)<br />
Select the ca.crt file we generated earlier and click &#8216;Open&#8217;<br />
Firefox will ask you:<br />
Do you want to trust &#8220;My CA&#8221; for the following purposes?<br />
Just select Trust this CA to identify websites<br />
Click &#8216;OK&#8217;<br />
Restart your browser</p>
<p>If you&#8217;ve followed everything correctly when you go to https://localhost (or whatever CommonName you specified)<br />
You will get a ssl encrypted site and no warnings about the certificate not being trusted.</p>
<div id="attachment_161" class="wp-caption alignnone" style="width: 310px"><a href="http://robaldred.co.uk/wp-content/uploads/2009/11/verified_cert.jpg"><img class="size-medium wp-image-161" title="verified_cert" src="http://robaldred.co.uk/wp-content/uploads/2009/11/verified_cert-300x125.jpg" alt="Example showing a local vhost with a verified cert" width="300" height="125" /></a><p class="wp-caption-text">Example showing a local vhost with a verified cert</p></div>
<p>If apache doesn&#8217;t come backup then apache&#8217;s config checks program is your best friend.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>httpd <span style="color: #660033;">-S</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/11/adding-httpsssl-support-to-your-apache-mod_ssl-development-osx-mac-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cucumber pretty html formatter for textmate</title>
		<link>http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/</link>
		<comments>http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 11:23:48 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=105</guid>
		<description><![CDATA[I&#8217;ve been using cucumber a lot recently along with the textmate bundle for it. The HTML output cucumber creates is fine, but not all that pretty. I&#8217;ve created a new formatter for cucumber to generate HTML enhanced with some javascript. My inspiration came from the textmate bundle for rspec. You can grap it off my [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://cukes.info" target="_blank">cucumber</a> a lot recently along with the textmate bundle for it.<br />
The HTML output cucumber creates is fine, but not all that pretty.</p>
<p>I&#8217;ve created a new formatter for cucumber to generate HTML enhanced with some javascript.<br />
My inspiration came from the textmate bundle for <a href="http://rspec.info" target="_blank">rspec</a>.</p>
<p>You can grap it off my <a href="http://github.com/raldred/cucumber_textmate/tree/master" target="_blank">github</a>.<br />
Here&#8217;s some screenshots:</p>

<a href='http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/cucumber_failure-2/' title='cucumber_failure'><img width="150" height="150" src="http://robaldred.co.uk/wp-content/uploads/2009/08/cucumber_failure-150x150.jpg" class="attachment-thumbnail" alt="cucumber_failure" title="cucumber_failure" /></a>
<a href='http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/cucumber_full-2/' title='cucumber_full'><img width="150" height="150" src="http://robaldred.co.uk/wp-content/uploads/2009/08/cucumber_full-150x150.jpg" class="attachment-thumbnail" alt="cucumber_full" title="cucumber_full" /></a>

<p><strong>UPDATE:</strong> I replaced the original html formatter in cucumber; as of 19th November my fork has been merged into Aslak&#8217;s cucumber/master upgrade to the cucumber 0.4.5 release.<br />
<a href="http://bit.ly/6beSgO">View the commit history</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/08/cucumber-pretty-html-formatter-for-textmate/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Restart macports MySQL 5 on OSX</title>
		<link>http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/</link>
		<comments>http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 16:14:52 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Mac Tips]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[mysql mac osx launchdaemons]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/</guid>
		<description><![CDATA[sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5.plist sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl unload <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>org.macports.mysql5.plist<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> launchctl load <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>org.macports.mysql5.plist</div></div>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/08/restart-macports-mysql-5-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom log files for your ruby on rails applications</title>
		<link>http://robaldred.co.uk/2009/01/custom-log-files-for-your-ruby-on-rails-applications/</link>
		<comments>http://robaldred.co.uk/2009/01/custom-log-files-for-your-ruby-on-rails-applications/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 15:38:47 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://robaldred.co.uk/?p=27</guid>
		<description><![CDATA[Sometimes logging is required but putting the messages in the Rails log isn’t the answer.For example you need to see the progress of customers through your order placement cycle, you ideally need this seperate to any other in a custom log file? There is a solution and it&#8217;s easy&#8230; To create an order progress log, [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes logging is required but putting the messages in the Rails log isn’t the answer.For example you need to see the progress of customers through your order placement cycle, you ideally need this seperate to any other in a custom log file?</p>
<p>There is a solution and it&#8217;s easy&#8230; To create an order progress log, simply create a new instance of <em>Logger</em> and pass it a <em>File</em> instance for your own logfile.<br />
Create a new model which inherits from <em>Logger</em></p>
<pre lang="ruby">class OrderProgressLogger &lt; Logger
  def format_message(severity, timestamp, progname, msg)
  "#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n"
  end
end</pre>
<p>Create initializer called logs.rb in RAILS_ROOT/config/initializers with the following content:</p>
<pre lang="ruby">order_progress_logfile = File.open("#{RAILS_ROOT}/log/order_progress.log", 'a')
order_progress_logfile.sync = true
ORDER_PROGRESS_LOG = OrderProcessLogger.new(order_progress_logfile)</pre>
<p>After a restart of your mongrel or passenger <em>ORDER_PROGRESS_LOG</em> will be available through out your application.<br />
You log to it just as you would <em>DEFAULT_RAILS_LOGGER</em> like so&#8230;</p>
<pre lang="ruby">ORDER_PROGRESS_LOG.debug "Starting order placement method"
ORDER_PROGRESS_LOG.error "Could not create order record"</pre>
]]></content:encoded>
			<wfw:commentRss>http://robaldred.co.uk/2009/01/custom-log-files-for-your-ruby-on-rails-applications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
