[rspec-users] Rspec Style

Pat Maddox patmaddox at me.com
Wed Oct 30 23:02:37 UTC 2013


Curtis, hey man, I saw your post in the rspec list archives (http://rubyforge.org/pipermail/rspec-users/2013-August/021811.html). I use context with pattern A:

describe UsersController do
  describe "POST create" do
    it "creates a user" do
      ...
    end

    context "with bad data" do
      it "gives an error message"
    end
  end
end

The main describe "POST create" and its examples describe the primary behavior of the interaction. I use contexts to describe how behavior changes as the interaction changes.

Pat


More information about the rspec-users mailing list