Sha256: 250582615fd7739a02842cd2a5b1e6392dd0e4ca3147105cf99cba2ef4f16a53

Contents?: true

Size: 564 Bytes

Versions: 3

Compression:

Stored size: 564 Bytes

Contents

require 'rails_helper'

module WebAdmin
  RSpec.describe Post, :type => :model do
    context "Validations" do
      it { should validate_presence_of :user_id }
      it { should validate_presence_of :user }
      it { should validate_presence_of :title }
      it { should validate_presence_of :body }
    end

    context "Relationships" do
      it { should belong_to :user }
    end

    describe "to_s" do
      it 'return title' do
        subject.stub(title: "Primeiro Post")

        expect(subject.to_s).to eq "Primeiro Post"
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
web_admin-0.1.0 spec/models/admin_web/post_spec.rb
web_admin-0.0.2 spec/models/admin_web/post_spec.rb
web_admin-0.0.1 spec/models/admin_web/post_spec.rb