Skip to content
This repository

This branch is 0 commits ahead and 625 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

..
Octocat-spinner-32 README.md
Octocat-spinner-32 errors_on.feature
Octocat-spinner-32 transactional_examples.feature
README.md

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
Something went wrong with that request. Please try again.