Introduction to Writing Examples using Spec::Rails

Spec::Rails supports 4 different types of Executable Examples:

Each of these use specialized ExampleGroup subclasses to give you access to
the appropriate services and methods. The specific type of ExampleGroup is
determined implicitly by placing the examples in an appropriately named file
(*_spec.rb) within an appropriately named directory:

spec/controllers/**/*_spec.rb
spec/helpers/**/*_spec.rb
spec/models/**/*_spec.rb
spec/views/**/*_spec.rb

WARNING: If you do not follow these conventions,
you will not get the correct ExampleGroup subclass. If you prefer to disregard
this convention, you can get the correct ExampleGroup subclass by passing a
hash to the describe method:

describe "some model", :type => :model do
  ...
end

This works with :model, :view, :controller and :helper.