Sha256: ff52865c785fcc9c4df7693edfcb7fc410b85568282deb37a0315d213600dcfa

Contents?: true

Size: 620 Bytes

Versions: 37

Compression:

Stored size: 620 Bytes

Contents

Model specs live in `spec/models` or any example group with
`:type => :model`.

A model spec is a thin wrapper for an ActiveSupport::TestCase, and includes all
of the behavior and assertions that it provides, in addition to RSpec's own
behavior and expectations.

## Examples

    require "spec_helper"
    
    describe Post do
      context "with 2 or more comments" do
        it "orders them in reverse" do
          post = Post.create
          comment1 = post.comment("first")
          comment2 = post.comment("second")
          post.reload.comments.should eq([comment2, comment1])
        end
      end
    end

Version data entries

37 entries across 32 versions & 4 rubygems

Version Path
rspec-rails-2.12.2 features/model_specs/README.md
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
rspec-rails-2.12.1 features/model_specs/README.md
rspec-rails-2.12.0 features/model_specs/README.md
rspec-rails-2.11.4 features/model_specs/README.md
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/features/model_specs/README.md
rspec-rails-2.11.0 features/model_specs/README.md
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/README.md
rspec-rails-2.10.1 features/model_specs/README.md