Sha256: bd4c54fde056f413eda569a680e0c49d6cd5682e44b86d1d773e5d9744452837

Contents?: true

Size: 693 Bytes

Versions: 9

Compression:

Stored size: 693 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 chronologically" do
          post = Post.create!
          comment1 = post.comments.create!(:body => "first comment")
          comment2 = post.comments.create!(:body => "second comment")
          expect(post.reload.comments).to eq([comment2, comment1])
        end
      end
    end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-rails-2.13.0/features/model_specs/README.md
rspec-rails-3.0.0.beta2 features/model_specs/README.md
rspec-rails-2.99.0.beta2 features/model_specs/README.md
rspec-rails-2.14.1 features/model_specs/README.md
rspec-rails-3.0.0.beta1 features/model_specs/README.md
rspec-rails-2.99.0.beta1 features/model_specs/README.md
rspec-rails-2.14.0 features/model_specs/README.md
rspec-rails-2.13.1 features/model_specs/README.md
rspec-rails-2.13.0 features/model_specs/README.md