Posted in RSpec on January 5, 2008 | 1 Comment »
Here’s an annoying little issue. Annoying because I didn’t think it through.
Here’s the index.html.erb_spec.rb:
require File.dirname(__FILE__) + ‘/../../spec_helper’
describe “/folders/index.html.erb” do include FoldersHelper
before(:each) do folder_98 = mock_model(Folder) folder_98.should_receive(:name).and_return(“MyString”) folder_98.should_receive(:top_level).and_return(false) folder_99 = mock_model(Folder) folder_99.should_receive(:name).and_return(“MyString”) folder_99.should_receive(:top_level).and_return(false)
[...]
Read Full Post »
Posted in RSpec, Ruby, RubyOnRails on December 8, 2007 | Comments Off
So, I have a site that synchronizes data with another server. It does this via after_create, after_update and after_delete triggers on some models. All of those triggers use the same method that returns a connection object which has various methods such as:
# SyncServer::connection method module SyncServer def [...]
Read Full Post »
Posted in RSpec, RubyOnRails on December 6, 2007 | 6 Comments »
This took longer than I wanted…
Working on edge Rails and using RSpec I ran into a problem with the new forgery protection features and testing.
I’m using the new cookie session store, so I have the secret key commented out in application.rb:
protect_from_forgery # :secret => ’somefunkycoolsecret’
However, while using RSpec, this causes my tests to fail. [...]
Read Full Post »
Posted in RSpec, RubyOnRails on November 30, 2007 | 1 Comment »
I’m barely even a beginner at using RSpec, but one of the first tests I needed to do involved Attachment_Fu.
Here’s what I did to get my model to pass validation:
require File.dirname(__FILE__) + ‘/../spec_helper’
describe Image do # # I created the spec/images directory and placed this # test image prior to running [...]
Read Full Post »