[rspec-users] Specing Ajaxy Views

2010-12-29 Thread Shea Levy
Hi all, I am working on a feature to allow administrators of an online store to rearrange the order in which their product categories show up on the site. I want to use a simple implementation of sortable_lists (madrobby.github.com/scriptaculous/sortable-lists-demo/) to allow the administrators

[rspec-users] Webrat or RSpec and Table Headers

2010-12-28 Thread Shea Levy
Hi all, Suppose I have a table that lists all of my products, that includes a a somewhere in the first , and each product has its data held within a . After updating a product's description, I want to write something like: within "tr#category#{category.id}" do under_header "Description" do

[rspec-users] BDD and Interacting With External Resources

2010-12-28 Thread Shea Levy
Hi all, What's the best way to handle features which rely on an external API in a behaviour-driven way? Suppose I have an app which manages online ordering from several independent stores, with a cut taken from each purchase, and I want to add a feature whereby orders made by phone that were fa

[rspec-users] BDD and Performance

2010-12-28 Thread Shea Levy
Hi all, What's the best way to implement performance enhancements from the outside-in? For example, if I'm working test-free and I know I'm going to be looking up my Shops by phone number often, I'll write a migration to make phone_number an index of the shops table. What feature(s) and spec(s)

[rspec-users] Rescuing a Test-Free Project with RSpec and Cucumber

2010-12-11 Thread Shea Levy
Hi all, I was recently brought onto a Rails 2.2.3 project which was itself an emergency rescue of a spaghetti-coded PHP project (complete with hard-coded SQL statements!). Due to the fact that the code was already in production and has required fairly constant maintenance and feature additions,

[rspec-users] Mocking a Model Class and a View with RSpec-Rails

2010-12-07 Thread Shea Levy
communication. spec/controllers/users_controller_spec.rb: require 'spec_helper' describe UsersController do describe "POST create" do it "creates a new user" do User.should_receive(:new).with("name" => "Shea Levy") post :create, :user =