adds debate model specs [#5]

This commit is contained in:
rgarcia
2015-07-16 19:26:17 +02:00
parent 8df23ed498
commit 62349acc54

View File

@@ -1,5 +1,28 @@
require 'rails_helper'
RSpec.describe Debate, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
describe Debate do
before(:each) do
@debate = build(:debate)
end
it "should be valid" do
expect(@debate).to be_valid
end
it "should not be valid without a title" do
@debate.title = nil
expect(@debate).to_not be_valid
end
it "should not be valid without a description" do
@debate.description = nil
expect(@debate).to_not be_valid
end
it "should not be valid without accepting terms of service" do
@debate.terms_of_service = nil
expect(@debate).to_not be_valid
end
end